/frameworks/base/tools/localedata/ |
D | extract_icu_data.py | 26 def get_locale_parts(locale): argument 28 parts = locale.split('_') 111 def pack_to_uint32(locale): argument 113 lang, _, region = get_locale_parts(locale) 133 for locale in sorted(likely_script_dict.keys()): 134 script = likely_script_dict[locale] 136 pack_to_uint32(locale), 138 locale.replace('_', '-'), 143 def pack_to_uint64(locale): argument 145 _, 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 | 43 public static String toSentenceCase(String str, Locale locale) { in toSentenceCase() argument 45 return CaseMap.toTitle().wholeString().noLowercase().apply(locale, null, str); in toSentenceCase() 60 public static String normalizeForSearch(String str, Locale locale) { in normalizeForSearch() argument 70 private static boolean shouldUseDialectName(Locale locale) { in shouldUseDialectName() argument 71 final String lang = locale.getLanguage(); in shouldUseDialectName() 86 public static String getDisplayName(Locale locale, Locale displayLocale, boolean sentenceCase) { in getDisplayName() argument 88 String result = shouldUseDialectName(locale) in getDisplayName() 89 ? ULocale.getDisplayNameWithDialect(locale.toLanguageTag(), displayULocale) in getDisplayName() 90 : ULocale.getDisplayName(locale.toLanguageTag(), displayULocale); in getDisplayName() 101 public static String getDisplayName(Locale locale, boolean sentenceCase) { in getDisplayName() argument [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() 111 for (String locale : allLocales) { in getSupportedLocales() 112 if (localeFilter.test(locale)) { in getSupportedLocales() 113 result.add(locale); in getSupportedLocales() 149 for (String locale : localeList) { in getAllAssetLocales() 150 final Locale l = Locale.forLanguageTag(locale.replace('_', '-')); in getAllAssetLocales() [all …]
|
D | LocaleStore.java | 64 private LocaleInfo(Locale locale) { in LocaleInfo() argument 65 this.mLocale = locale; in LocaleInfo() 66 this.mId = locale.toLanguageTag(); in LocaleInfo() 67 this.mParent = getParent(locale); in LocaleInfo() 78 private static Locale getParent(Locale locale) { in getParent() argument 79 if (locale.getCountry().isEmpty()) { in getParent() 83 .setLocale(locale) in getParent() 268 Locale locale = localeList == null ? null : localeList.get(0); in getAppCurrentLocaleInfo() local 270 if (locale != null) { in getAppCurrentLocaleInfo() 271 LocaleInfo localeInfo = new LocaleInfo(locale); in getAppCurrentLocaleInfo() [all …]
|
D | SuggestedLocaleAdapter.java | 176 public void setDisplayLocale(@NonNull Context context, @Nullable Locale locale) { in setDisplayLocale() argument 177 if (locale == null) { in setDisplayLocale() 180 } else if (!locale.equals(mDisplayLocale)) { in setDisplayLocale() 181 mDisplayLocale = locale; in setDisplayLocale() 183 configOverride.setLocale(locale); in setDisplayLocale() 230 title = itemView.findViewById(R.id.locale); in getView() 239 updateTextView(itemView, itemView.findViewById(R.id.locale), position); in getView() 272 && convertView.findViewById(R.id.locale) != null; in getNewViewIfNeeded() 290 && convertView.findViewById(R.id.locale) != null; in getNewViewIfNeeded() 339 Locale locale = Locale.getDefault(); in performFiltering() local [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 …]
|
D | AllCapsTransformationMethod.java | 58 Locale locale = null; in getTransformation() local 60 locale = ((TextView)view).getTextLocale(); in getTransformation() 62 if (locale == null) { in getTransformation() 63 locale = mLocale; in getTransformation() 66 return TextUtils.toUpperCase(locale, source, copySpans); in getTransformation()
|
/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 const uint8_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, minikin::Hyphenator::loadBinary( in addHyphenatorWithoutPatternFile() 63 nullptr, minPrefix, minSuffix, locale)); in addHyphenatorWithoutPatternFile() 66 static void addHyphenator(const std::string& locale, int minPrefix, int minSuffix) { in addHyphenator() argument 67 const uint8_t* ptr = 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 DateTimePatternGenerator dtpg = DateTimePatternGenerator.getInstance(locale); in getBestDateTimePattern() 282 final Locale locale = context.getResources().getConfiguration().locale; in getTimeFormat() local 283 return new java.text.SimpleDateFormat(getTimeFormatString(context), locale); in getTimeFormat() 307 context.getResources().getConfiguration().locale); in getTimeFormatString() [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/os/ |
D | LocaleList.java | 87 public int indexOf(Locale locale) { in indexOf() argument 89 if (mList[i].equals(locale)) { in indexOf() 281 private static String getLikelyScript(Locale locale) { in getLikelyScript() argument 282 final String script = locale.getScript(); in getLikelyScript() 287 return ULocale.addLikelySubtags(ULocale.forLocale(locale)).getScript(); in getLikelyScript() 297 private static boolean isPseudoLocale(String locale) { in isPseudoLocale() argument 298 return STRING_EN_XA.equals(locale) || STRING_AR_XB.equals(locale); in isPseudoLocale() 305 public static boolean isPseudoLocale(Locale locale) { in isPseudoLocale() argument 306 return LOCALE_EN_XA.equals(locale) || LOCALE_AR_XB.equals(locale); in isPseudoLocale() 312 public static boolean isPseudoLocale(@Nullable ULocale locale) { in isPseudoLocale() argument [all …]
|
/frameworks/base/media/java/android/media/voice/ |
D | KeyphraseModelManager.java | 84 @NonNull Locale locale) { in getKeyphraseSoundModel() argument 85 Objects.requireNonNull(locale); in getKeyphraseSoundModel() 88 locale.toLanguageTag()); in getKeyphraseSoundModel() 145 public void deleteKeyphraseSoundModel(int keyphraseId, @NonNull Locale locale) { in deleteKeyphraseSoundModel() argument 146 Objects.requireNonNull(locale); in deleteKeyphraseSoundModel() 149 locale.toLanguageTag()); in deleteKeyphraseSoundModel()
|
/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 …]
|
D | SpellCheckerSubtype.java | 84 public SpellCheckerSubtype(int nameId, String locale, String languageTag, String extraValue, in SpellCheckerSubtype() argument 87 mSubtypeLocale = locale != null ? locale : ""; in SpellCheckerSubtype() 106 public SpellCheckerSubtype(int nameId, String locale, String extraValue) { in SpellCheckerSubtype() argument 107 this(nameId, locale, SUBTYPE_LANGUAGE_TAG_NONE, extraValue, SUBTYPE_ID_NONE); in SpellCheckerSubtype() 248 final Locale locale = getLocaleObject(); in getDisplayName() local 249 final String localeStr = locale != null ? locale.getDisplayName() : mSubtypeLocale; in getDisplayName() 289 private static int hashCodeInternal(String locale, String extraValue) { in hashCodeInternal() argument 290 return Arrays.hashCode(new Object[] {locale, extraValue}); in hashCodeInternal()
|