/frameworks/base/tools/localedata/ |
D | extract_icu_data.py | 28 def get_locale_parts(locale): argument 30 parts = locale.split('_') 114 def pack_to_uint32(locale): argument 116 lang, _, region = get_locale_parts(locale) 136 for locale in sorted(likely_script_dict.keys()): 137 script = likely_script_dict[locale] 139 pack_to_uint32(locale), 141 locale.replace('_', '-'), 146 def pack_to_uint64(locale): argument 148 _, script, _ = get_locale_parts(locale) [all …]
|
/frameworks/base/tools/aapt2/configuration/ |
D | ConfigurationParser_test.cpp | 92 <locale-groups> 93 <locale-group label="europe" version-code-order="1"> 94 <locale>en</locale> 95 <locale>es</locale> 96 <locale>fr</locale> 97 <locale>de</locale> 98 </locale-group> 99 <locale-group label="north-america" version-code-order="2"> 100 <locale>en</locale> 101 <locale>es-rMX</locale> [all …]
|
/frameworks/opt/localepicker/src/com/android/localepicker/ |
D | LocaleHelper.java | 68 static String toSentenceCase(String str, Locale locale) { in toSentenceCase() argument 73 return str.substring(0, firstCodePointLen).toUpperCase(locale) in toSentenceCase() 88 static String normalizeForSearch(String str, Locale locale) { in normalizeForSearch() argument 98 private static boolean shouldUseDialectName(Locale locale) { in shouldUseDialectName() argument 99 final String lang = locale.getLanguage(); in shouldUseDialectName() 113 public static String getDisplayName(Locale locale, Locale displayLocale, boolean sentenceCase) { in getDisplayName() argument 115 String result = shouldUseDialectName(locale) in getDisplayName() 116 ? ULocale.getDisplayNameWithDialect(locale.toLanguageTag(), displayULocale) in getDisplayName() 117 : ULocale.getDisplayName(locale.toLanguageTag(), displayULocale); in getDisplayName() 128 public static String getDisplayName(Locale locale, boolean sentenceCase) { in getDisplayName() argument [all …]
|
D | LocaleStore.java | 59 private LocaleInfo(Locale locale) { in LocaleInfo() argument 60 this.mLocale = locale; in LocaleInfo() 61 this.mId = locale.toLanguageTag(); in LocaleInfo() 62 this.mParent = getParent(locale); in LocaleInfo() 73 private static Locale getParent(Locale locale) { in getParent() argument 74 if (locale.getCountry().isEmpty()) { in getParent() 78 .setLocale(locale) in getParent() 245 private static void addSuggestedLocalesForRegion(Locale locale) { in addSuggestedLocalesForRegion() argument 246 if (locale == null) { in addSuggestedLocalesForRegion() 249 final String country = locale.getCountry(); in addSuggestedLocalesForRegion() [all …]
|
/frameworks/base/core/java/com/android/internal/app/ |
D | LocaleHelper.java | 44 public static String toSentenceCase(String str, Locale locale) { in toSentenceCase() argument 46 return CaseMap.toTitle().wholeString().noLowercase().apply(locale, null, str); in toSentenceCase() 61 public static String normalizeForSearch(String str, Locale locale) { in normalizeForSearch() argument 71 private static boolean shouldUseDialectName(Locale locale) { in shouldUseDialectName() argument 72 final String lang = locale.getLanguage(); in shouldUseDialectName() 87 public static String getDisplayName(Locale locale, Locale displayLocale, boolean sentenceCase) { in getDisplayName() argument 89 String result = shouldUseDialectName(locale) in getDisplayName() 90 ? ULocale.getDisplayNameWithDialect(locale.toLanguageTag(), displayULocale) in getDisplayName() 91 : ULocale.getDisplayName(locale.toLanguageTag(), displayULocale); in getDisplayName() 102 public static String getDisplayName(Locale locale, boolean sentenceCase) { in getDisplayName() argument [all …]
|
D | LocaleStore.java | 105 private LocaleInfo(Locale locale) { in LocaleInfo() argument 106 this.mLocale = locale; in LocaleInfo() 107 this.mId = locale.toLanguageTag(); in LocaleInfo() 108 this.mParent = getParent(locale); in LocaleInfo() 131 private static Locale getParent(Locale locale) { in getParent() argument 132 if (locale.getCountry().isEmpty()) { in getParent() 136 .setLocale(locale) in getParent() 213 Locale locale = mLocale.stripExtensions(); in getFullNameNative() local 215 LocaleHelper.getDisplayName(locale, locale, true /* sentence case */); in getFullNameNative() 239 Locale locale = mLocale.stripExtensions(); in getFullNameInUiLanguage() local [all …]
|
D | LocalePicker.java | 62 public void onLocaleSelected(Locale locale); in onLocaleSelected() argument 71 final Locale locale; field in LocalePicker.LocaleInfo 73 public LocaleInfo(String label, Locale locale) { in LocaleInfo() argument 75 this.locale = locale; in LocaleInfo() 84 return locale; in getLocale() 114 for (String locale : allLocales) { in getSupportedLocales() 115 if (localeFilter.test(locale)) { in getSupportedLocales() 116 result.add(locale); in getSupportedLocales() 152 for (String locale : localeList) { in getAllAssetLocales() 153 final Locale l = Locale.forLanguageTag(locale.replace('_', '-')); in getAllAssetLocales() [all …]
|
/frameworks/base/core/java/android/text/method/ |
D | TimeKeyListener.java | 67 public TimeKeyListener(@Nullable Locale locale) { in TimeKeyListener() argument 71 final boolean success = NumberKeyListener.addDigits(chars, locale) in TimeKeyListener() 72 && NumberKeyListener.addAmPmChars(chars, locale) in TimeKeyListener() 74 chars, locale, SKELETON_12HOUR, SYMBOLS_TO_IGNORE) in TimeKeyListener() 76 chars, locale, SKELETON_24HOUR, SYMBOLS_TO_IGNORE); in TimeKeyListener() 79 if (locale != null && "en".equals(locale.getLanguage())) { in TimeKeyListener() 106 public static TimeKeyListener getInstance(@Nullable Locale locale) { in getInstance() argument 109 instance = sInstanceCache.get(locale); in getInstance() 111 instance = new TimeKeyListener(locale); in getInstance() 112 sInstanceCache.put(locale, instance); in getInstance()
|
D | DateTimeKeyListener.java | 67 public DateTimeKeyListener(@Nullable Locale locale) { in DateTimeKeyListener() argument 71 final boolean success = NumberKeyListener.addDigits(chars, locale) in DateTimeKeyListener() 72 && NumberKeyListener.addAmPmChars(chars, locale) in DateTimeKeyListener() 74 chars, locale, SKELETON_12HOUR, SYMBOLS_TO_IGNORE) in DateTimeKeyListener() 76 chars, locale, SKELETON_24HOUR, SYMBOLS_TO_IGNORE); in DateTimeKeyListener() 79 if (locale != null && "en".equals(locale.getLanguage())) { in DateTimeKeyListener() 106 public static DateTimeKeyListener getInstance(@Nullable Locale locale) { in getInstance() argument 109 instance = sInstanceCache.get(locale); in getInstance() 111 instance = new DateTimeKeyListener(locale); in getInstance() 112 sInstanceCache.put(locale, instance); in getInstance()
|
D | DateKeyListener.java | 65 public DateKeyListener(@Nullable Locale locale) { in DateKeyListener() argument 69 final boolean success = NumberKeyListener.addDigits(chars, locale) in DateKeyListener() 71 chars, locale, SKELETONS, SYMBOLS_TO_IGNORE); in DateKeyListener() 94 public static DateKeyListener getInstance(@Nullable Locale locale) { in getInstance() argument 97 instance = sInstanceCache.get(locale); in getInstance() 99 instance = new DateKeyListener(locale); in getInstance() 100 sInstanceCache.put(locale, instance); in getInstance()
|
D | DigitsKeyListener.java | 116 public DigitsKeyListener(@Nullable Locale locale) { in DigitsKeyListener() argument 117 this(locale, false, false); in DigitsKeyListener() 155 public DigitsKeyListener(@Nullable Locale locale, boolean sign, boolean decimal) { in DigitsKeyListener() argument 159 mLocale = locale; in DigitsKeyListener() 160 if (locale == null) { in DigitsKeyListener() 165 final boolean success = NumberKeyListener.addDigits(chars, locale); in DigitsKeyListener() 171 final DecimalFormatSymbols symbols = DecimalFormatSymbols.getInstance(locale); in DigitsKeyListener() 249 public static DigitsKeyListener getInstance(@Nullable Locale locale) { in getInstance() argument 250 return getInstance(locale, false, false); in getInstance() 265 @Nullable Locale locale, boolean sign, boolean decimal) { in getInstance() [all …]
|
D | NumberKeyListener.java | 151 static boolean addDigits(@NonNull Collection<Character> collection, @Nullable Locale locale) { in addDigits() argument 152 if (locale == null) { in addDigits() 155 final String[] digits = DecimalFormatSymbols.getInstance(locale).getDigitStrings(); in addDigits() 172 @NonNull Collection<Character> collection, @Nullable Locale locale, in addFormatCharsFromSkeleton() argument 174 if (locale == null) { in addFormatCharsFromSkeleton() 177 final String pattern = DateFormat.getBestDateTimePattern(locale, skeleton); in addFormatCharsFromSkeleton() 210 @NonNull Collection<Character> collection, @Nullable Locale locale, in addFormatCharsFromSkeletons() argument 214 collection, locale, skeletons[i], symbolsToIgnore); in addFormatCharsFromSkeletons() 225 @Nullable Locale locale) { in addAmPmChars() argument 226 if (locale == null) { in addAmPmChars() [all …]
|
/frameworks/base/core/jni/ |
D | android_text_Hyphenator.cpp | 30 static std::string buildFileName(const std::string& locale) { in buildFileName() argument 34 lowerLocale.reserve(locale.size()); in buildFileName() 35 std::transform(locale.begin(), locale.end(), std::back_inserter(lowerLocale), ::tolower); in buildFileName() 39 static std::pair<const uint8_t*, size_t> mmapPatternFile(const std::string& locale) { in mmapPatternFile() argument 40 const std::string hyFilePath = buildFileName(locale); in mmapPatternFile() 60 static void addHyphenatorWithoutPatternFile(const std::string& locale, int minPrefix, in addHyphenatorWithoutPatternFile() argument 62 minikin::addHyphenator(locale, in addHyphenatorWithoutPatternFile() 64 locale)); in addHyphenatorWithoutPatternFile() 67 static void addHyphenator(const std::string& locale, int minPrefix, int minSuffix) { in addHyphenator() argument 68 std::pair<const uint8_t*, size_t> r = mmapPatternFile(locale); in addHyphenator() [all …]
|
/frameworks/minikin/libs/minikin/ |
D | HyphenatorMap.cpp | 49 const Locale locale(localeStr); in addInternal() local 52 mMap[locale.getIdentifier()] = hyphenator; in addInternal() 73 const Hyphenator* HyphenatorMap::lookupInternal(const Locale& locale) { in lookupInternal() argument 74 const uint64_t id = locale.getIdentifier(); in lookupInternal() 82 result = lookupBySubtag(locale, LANGUAGE | REGION | SCRIPT | VARIANT); in lookupInternal() 87 result = lookupBySubtag(locale, LANGUAGE | REGION | VARIANT); in lookupInternal() 92 result = lookupBySubtag(locale, LANGUAGE | VARIANT); in lookupInternal() 97 result = lookupBySubtag(locale, LANGUAGE); in lookupInternal() 102 result = lookupBySubtag(locale, SCRIPT); in lookupInternal() 120 const Hyphenator* HyphenatorMap::lookupBySubtag(const Locale& locale, SubtagBits bits) const { in lookupBySubtag() argument [all …]
|
D | LocaleListCache.cpp | 35 static size_t toLanguageTag(char* output, size_t outSize, const StringPiece& locale) { in toLanguageTag() argument 37 if (locale.empty()) { in toLanguageTag() 41 std::string localeString = locale.toString(); // ICU only understands C-style string. in toLanguageTag() 93 Locale locale(StringPiece(langTag, length)); in parseLocaleList() local 94 if (locale.isUnsupported()) { in parseLocaleList() 97 const bool isNewLocale = seen.insert(locale.getIdentifier()).second; in parseLocaleList() 102 result.push_back(locale); in parseLocaleList() 112 for (const auto& locale : locales) { in operator ()() local 113 uint64_t id = locale.getIdentifier(); in operator ()()
|
/frameworks/base/core/java/android/view/ |
D | AccessibilityIterators.java | 81 public static CharacterTextSegmentIterator getInstance(Locale locale) { in getInstance() argument 83 sInstance = new CharacterTextSegmentIterator(locale); in getInstance() 88 private CharacterTextSegmentIterator(Locale locale) { in CharacterTextSegmentIterator() argument 89 mLocale = locale; in CharacterTextSegmentIterator() 90 onLocaleChanged(locale); in CharacterTextSegmentIterator() 154 final Locale locale = globalConfig.getLocales().get(0); in onConfigurationChanged() local 155 if (locale == null) { in onConfigurationChanged() 158 if (!mLocale.equals(locale)) { in onConfigurationChanged() 159 mLocale = locale; in onConfigurationChanged() 160 onLocaleChanged(locale); in onConfigurationChanged() [all …]
|
/frameworks/base/core/java/android/text/format/ |
D | DateFormat.java | 203 return is24HourLocale(context.getResources().getConfiguration().locale); in is24HourFormat() 213 public static boolean is24HourLocale(@NonNull Locale locale) { in is24HourLocale() argument 215 if (sIs24HourLocale != null && sIs24HourLocale.equals(locale)) { in is24HourLocale() 221 java.text.DateFormat.getTimeInstance(java.text.DateFormat.LONG, locale); in is24HourLocale() 233 sIs24HourLocale = locale; in is24HourLocale() 267 public static String getBestDateTimePattern(Locale locale, String skeleton) { in getBestDateTimePattern() argument 268 ULocale uLocale = ULocale.forLocale(locale); in getBestDateTimePattern() 284 final Locale locale = context.getResources().getConfiguration().locale; in getTimeFormat() local 285 return new java.text.SimpleDateFormat(getTimeFormatString(context), locale); in getTimeFormat() 308 ULocale uLocale = ULocale.forLocale(context.getResources().getConfiguration().locale); in getTimeFormatString() [all …]
|
D | Formatter.java | 83 final Locale locale = localeFromContext(context); in bidiWrap() local 84 if (TextUtils.getLayoutDirectionFromLocale(locale) == View.LAYOUT_DIRECTION_RTL) { in bidiWrap() 134 private static NumberFormat getNumberFormatter(Locale locale, int fractionDigits) { in getNumberFormatter() argument 135 final NumberFormat numberFormatter = NumberFormat.getInstance(locale); in getNumberFormatter() 157 private static String formatMeasureShort(Locale locale, NumberFormat numberFormatter, in formatMeasureShort() argument 160 locale, MeasureFormat.FormatWidth.SHORT, numberFormatter); in formatMeasureShort() 169 final Locale locale = localeFromContext(context); in formatRoundedBytesResult() local 170 final NumberFormat numberFormatter = getNumberFormatter(locale, input.fractionDigits); in formatRoundedBytesResult() 177 return formatMeasureShort(locale, numberFormatter, input.value, input.units); in formatRoundedBytesResult() 278 final Locale locale = res.getConfiguration().getLocales().get(0); in formatBytes() local [all …]
|
/frameworks/base/packages/SettingsLib/src/com/android/settingslib/datetime/ |
D | ZoneGetter.java | 100 Locale locale = context.getResources().getConfiguration().locale; in getTimeZoneOffsetAndName() local 101 TimeZoneFormat tzFormatter = TimeZoneFormat.getInstance(locale); in getTimeZoneOffsetAndName() 102 CharSequence gmtText = getGmtOffsetText(tzFormatter, locale, tz, now); in getTimeZoneOffsetAndName() 103 TimeZoneNames timeZoneNames = TimeZoneNames.getInstance(locale); in getTimeZoneOffsetAndName() 105 locale, getZoneLongName(locale, timeZoneNames, tz, now)); in getTimeZoneOffsetAndName() 125 Locale locale, @Nullable String toCapitalize) { in capitalizeForStandaloneDisplay() argument 129 return LocaleHelper.toSentenceCase(toCapitalize, locale); in capitalizeForStandaloneDisplay() 133 final Locale locale = context.getResources().getConfiguration().locale; in getZonesList() local 135 final TimeZoneNames timeZoneNames = TimeZoneNames.getInstance(locale); in getZonesList() 140 shouldUseExemplarLocationForLocalNames(locale, data, timeZoneNames); in getZonesList() [all …]
|
/frameworks/base/core/java/android/provider/ |
D | UserDictionary.java | 139 final Locale locale; in addWord() local 142 locale = Locale.getDefault(); in addWord() 144 locale = null; in addWord() 147 addWord(context, word, frequency, null, locale); in addWord() 162 int frequency, String shortcut, Locale locale) { in addWord() argument 177 values.put(LOCALE, null == locale ? null : locale.toString()); in addWord()
|
/frameworks/minikin/tests/unittest/ |
D | FontLanguageListCacheTest.cpp | 68 for (const std::string& locale : locales) { in TEST() local 69 LocaleListCache::writeTo(&fakeWriter, LocaleListCache::getId(locale)); in TEST() 74 for (const std::string& locale : locales) { in TEST() local 75 LocaleListCache::writeTo(&writer, LocaleListCache::getId(locale)); in TEST() 79 for (const std::string& locale : locales) { in TEST() local 80 EXPECT_EQ(LocaleListCache::getId(locale), LocaleListCache::readFrom(&reader)) in TEST() 81 << "locale = " << locale; in TEST()
|
/frameworks/base/core/java/android/view/textservice/ |
D | TextServicesManager.java | 154 private static String parseLanguageFromLocaleString(String locale) { in parseLanguageFromLocaleString() argument 155 final int idx = locale.indexOf('_'); in parseLanguageFromLocaleString() 157 return locale; in parseLanguageFromLocaleString() 159 return locale.substring(0, idx); in parseLanguageFromLocaleString() 186 @Nullable Locale locale, in newSpellCheckerSession() argument 195 .setLocale(locale) in newSpellCheckerSession() 222 Locale locale = params.getLocale(); in newSpellCheckerSession() local 223 if (!params.shouldReferToSpellCheckerLanguageSettings() && locale == null) { in newSpellCheckerSession() 247 if (locale != null) { in newSpellCheckerSession() 250 if (subtypeLanguage.length() < 2 || !locale.getLanguage().equals(subtypeLanguage)) { in newSpellCheckerSession() [all …]
|
/frameworks/base/services/core/java/com/android/server/inputmethod/ |
D | LocaleUtils.java | 181 final Locale locale = extractor.get(sources.get(i)); in filterByLanguage() local 182 if (locale == null) { in filterByLanguage() 189 if (!TextUtils.equals(locale.getLanguage(), preferredLocale.getLanguage())) { in filterByLanguage() 198 preferredULocaleCache[j], ULocale.forLocale(locale)); in filterByLanguage() 207 final String lang = locale.getLanguage(); in filterByLanguage() 232 static String getLanguageFromLocaleString(String locale) { in getLanguageFromLocaleString() argument 233 final int idx = locale.indexOf('_'); in getLanguageFromLocaleString() 235 return locale; in getLanguageFromLocaleString() 237 return locale.substring(0, idx); in getLanguageFromLocaleString() 243 return context.getResources().getConfiguration().locale; in getSystemLocaleFromContext()
|
/frameworks/base/core/java/android/os/ |
D | LocaleList.java | 88 public int indexOf(Locale locale) { in indexOf() argument 90 if (mList[i].equals(locale)) { in indexOf() 301 private static String getLikelyScript(Locale locale) { in getLikelyScript() argument 302 final String script = locale.getScript(); in getLikelyScript() 307 return ULocale.addLikelySubtags(ULocale.forLocale(locale)).getScript(); in getLikelyScript() 317 private static boolean isPseudoLocale(String locale) { in isPseudoLocale() argument 318 return STRING_EN_XA.equals(locale) || STRING_AR_XB.equals(locale); in isPseudoLocale() 325 public static boolean isPseudoLocale(Locale locale) { in isPseudoLocale() argument 326 return LOCALE_EN_XA.equals(locale) || LOCALE_AR_XB.equals(locale); in isPseudoLocale() 332 public static boolean isPseudoLocale(@Nullable ULocale locale) { in isPseudoLocale() argument [all …]
|
/frameworks/base/tools/aapt2/cmd/ |
D | Link_test.cpp | 793 <locale-config xmlns:android="http://schemas.android.com/apk/res/android"> in TEST_F() 794 <locale android:name="en-US"/> in TEST_F() 795 <locale android:name="pt"/> in TEST_F() 796 <locale android:name="es-419"/> in TEST_F() 797 <locale android:name="zh-Hans-SG"/> in TEST_F() 798 </locale-config>)", in TEST_F() 821 <locale-config xmlns:android="http://schemas.android.com/apk/res/android"> in TEST_F() 822 </locale-config>)", in TEST_F() 846 <locale-config xmlns:android="http://schemas.android.com/apk/res/android"> in TEST_F() 847 <locale android:name="en-US"/> in TEST_F() [all …]
|