Home
last modified time | relevance | path

Searched refs:locale (Results 1 – 25 of 192) sorted by relevance

12345678

/frameworks/base/tools/localedata/
Dextract_icu_data.py26 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/opt/localepicker/src/com/android/localepicker/
DLocaleHelper.java68 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 …]
DLocaleStore.java59 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/tools/aapt2/configuration/
DConfigurationParser_test.cpp111 <locale-groups>
112 <locale-group label="europe" version-code-order="1">
113 <locale>en</locale>
114 <locale>es</locale>
115 <locale>fr</locale>
116 <locale>de</locale>
117 </locale-group>
118 <locale-group label="north-america" version-code-order="2">
119 <locale>en</locale>
120 <locale>es-rMX</locale>
[all …]
/frameworks/base/core/java/com/android/internal/app/
DLocaleHelper.java68 public static String toSentenceCase(String str, Locale locale) { in toSentenceCase() argument
73 return str.substring(0, firstCodePointLen).toUpperCase(locale) in toSentenceCase()
89 public static String normalizeForSearch(String str, Locale locale) { in normalizeForSearch() argument
99 private static boolean shouldUseDialectName(Locale locale) { in shouldUseDialectName() argument
100 final String lang = locale.getLanguage(); in shouldUseDialectName()
115 public static String getDisplayName(Locale locale, Locale displayLocale, boolean sentenceCase) { in getDisplayName() argument
117 String result = shouldUseDialectName(locale) in getDisplayName()
118 ? ULocale.getDisplayNameWithDialect(locale.toLanguageTag(), displayULocale) in getDisplayName()
119 : ULocale.getDisplayName(locale.toLanguageTag(), displayULocale); in getDisplayName()
130 public static String getDisplayName(Locale locale, boolean sentenceCase) { in getDisplayName() argument
[all …]
DLocalePicker.java54 public void onLocaleSelected(Locale locale); in onLocaleSelected() argument
63 final Locale locale; field in LocalePicker.LocaleInfo
65 public LocaleInfo(String label, Locale locale) { in LocaleInfo() argument
67 this.locale = locale; in LocaleInfo()
76 return locale; in getLocale()
110 for (String locale : localeList) { in getAllAssetLocales()
111 final Locale l = Locale.forLanguageTag(locale.replace('_', '-')); in getAllAssetLocales()
132 if (previous.locale.getLanguage().equals(l.getLanguage()) && in getAllAssetLocales()
133 !previous.locale.getLanguage().equals("zz")) { in getAllAssetLocales()
136 … getDisplayName(previous.locale, specialLocaleCodes, specialLocaleNames)); in getAllAssetLocales()
[all …]
DLocaleStore.java55 private LocaleInfo(Locale locale) { in LocaleInfo() argument
56 this.mLocale = locale; in LocaleInfo()
57 this.mId = locale.toLanguageTag(); in LocaleInfo()
58 this.mParent = getParent(locale); in LocaleInfo()
69 private static Locale getParent(Locale locale) { in getParent() argument
70 if (locale.getCountry().isEmpty()) { in getParent()
74 .setLocale(locale) in getParent()
246 private static void addSuggestedLocalesForRegion(Locale locale) { in addSuggestedLocalesForRegion() argument
247 if (locale == null) { in addSuggestedLocalesForRegion()
250 final String country = locale.getCountry(); in addSuggestedLocalesForRegion()
[all …]
DSuggestedLocaleAdapter.java141 public void setDisplayLocale(@NonNull Context context, @Nullable Locale locale) { in setDisplayLocale() argument
142 if (locale == null) { in setDisplayLocale()
145 } else if (!locale.equals(mDisplayLocale)) { in setDisplayLocale()
146 mDisplayLocale = locale; in setDisplayLocale()
148 configOverride.setLocale(locale); in setDisplayLocale()
196 TextView text = (TextView) convertView.findViewById(R.id.locale); in getView()
253 Locale locale = Locale.getDefault(); in performFiltering() local
254 String prefixString = LocaleHelper.normalizeForSearch(prefix.toString(), locale); in performFiltering()
262 value.getFullNameInUiLanguage(), locale); in performFiltering()
264 value.getFullNameNative(), locale); in performFiltering()
/frameworks/base/core/jni/
Dandroid_text_Hyphenator.cpp29 static std::string buildFileName(const std::string& locale) { in buildFileName() argument
33 lowerLocale.reserve(locale.size()); in buildFileName()
34 std::transform(locale.begin(), locale.end(), std::back_inserter(lowerLocale), ::tolower); in buildFileName()
38 static const uint8_t* mmapPatternFile(const std::string& locale) { in mmapPatternFile() argument
39 const std::string hyFilePath = buildFileName(locale); in mmapPatternFile()
59 static void addHyphenatorWithoutPatternFile(const std::string& locale, int minPrefix, in addHyphenatorWithoutPatternFile() argument
61 minikin::addHyphenator(locale, minikin::Hyphenator::loadBinary( in addHyphenatorWithoutPatternFile()
62 nullptr, minPrefix, minSuffix, locale)); in addHyphenatorWithoutPatternFile()
65 static void addHyphenator(const std::string& locale, int minPrefix, int minSuffix) { in addHyphenator() argument
66 const uint8_t* ptr = mmapPatternFile(locale); in addHyphenator()
[all …]
/frameworks/base/core/java/android/text/method/
DTimeKeyListener.java67 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()
DDateTimeKeyListener.java67 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()
DDateKeyListener.java65 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()
DDigitsKeyListener.java116 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 …]
DNumberKeyListener.java153 static boolean addDigits(@NonNull Collection<Character> collection, @Nullable Locale locale) { in addDigits() argument
154 if (locale == null) { in addDigits()
157 final String[] digits = DecimalFormatSymbols.getInstance(locale).getDigitStrings(); in addDigits()
174 @NonNull Collection<Character> collection, @Nullable Locale locale, in addFormatCharsFromSkeleton() argument
176 if (locale == null) { in addFormatCharsFromSkeleton()
179 final String pattern = DateFormat.getBestDateTimePattern(locale, skeleton); in addFormatCharsFromSkeleton()
212 @NonNull Collection<Character> collection, @Nullable Locale locale, in addFormatCharsFromSkeletons() argument
216 collection, locale, skeletons[i], symbolsToIgnore); in addFormatCharsFromSkeletons()
227 @Nullable Locale locale) { in addAmPmChars() argument
228 if (locale == null) { in addAmPmChars()
[all …]
DAllCapsTransformationMethod.java58 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/java/android/view/
DAccessibilityIterators.java80 public static CharacterTextSegmentIterator getInstance(Locale locale) { in getInstance() argument
82 sInstance = new CharacterTextSegmentIterator(locale); in getInstance()
87 private CharacterTextSegmentIterator(Locale locale) { in CharacterTextSegmentIterator() argument
88 mLocale = locale; in CharacterTextSegmentIterator()
89 onLocaleChanged(locale); in CharacterTextSegmentIterator()
153 final Locale locale = globalConfig.getLocales().get(0); in onConfigurationChanged() local
154 if (locale == null) { in onConfigurationChanged()
157 if (!mLocale.equals(locale)) { in onConfigurationChanged()
158 mLocale = locale; in onConfigurationChanged()
159 onLocaleChanged(locale); in onConfigurationChanged()
[all …]
/frameworks/minikin/libs/minikin/
DHyphenatorMap.cpp49 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 …]
DLocaleListCache.cpp34 static size_t toLanguageTag(char* output, size_t outSize, const StringPiece& locale) { in toLanguageTag() argument
36 if (locale.empty()) { in toLanguageTag()
40 std::string localeString = locale.toString(); // ICU only understands C-style string. in toLanguageTag()
92 Locale locale(StringPiece(langTag, length)); in parseLocaleList() local
93 if (locale.isUnsupported()) { in parseLocaleList()
96 const bool isNewLocale = seen.insert(locale.getIdentifier()).second; in parseLocaleList()
101 result.push_back(locale); in parseLocaleList()
/frameworks/base/core/java/android/text/format/
DDateFormat.java189 return is24HourLocale(context.getResources().getConfiguration().locale); in is24HourFormat()
199 public static boolean is24HourLocale(@NonNull Locale locale) { in is24HourLocale() argument
201 if (sIs24HourLocale != null && sIs24HourLocale.equals(locale)) { in is24HourLocale()
207 java.text.DateFormat.getTimeInstance(java.text.DateFormat.LONG, locale); in is24HourLocale()
219 sIs24HourLocale = locale; in is24HourLocale()
253 public static String getBestDateTimePattern(Locale locale, String skeleton) { in getBestDateTimePattern() argument
254 return ICU.getBestDateTimePattern(skeleton, locale); in getBestDateTimePattern()
264 final Locale locale = context.getResources().getConfiguration().locale; in getTimeFormat() local
265 return new java.text.SimpleDateFormat(getTimeFormatString(context), locale); in getTimeFormat()
288 final LocaleData d = LocaleData.get(context.getResources().getConfiguration().locale); in getTimeFormatString()
[all …]
/frameworks/base/core/java/android/view/textservice/
DTextServicesManager.java128 private static String parseLanguageFromLocaleString(String locale) { in parseLanguageFromLocaleString() argument
129 final int idx = locale.indexOf('_'); in parseLanguageFromLocaleString()
131 return locale; in parseLanguageFromLocaleString()
133 return locale.substring(0, idx); in parseLanguageFromLocaleString()
151 public SpellCheckerSession newSpellCheckerSession(Bundle bundle, Locale locale, in newSpellCheckerSession() argument
156 if (!referToSpellCheckerLanguageSettings && locale == null) { in newSpellCheckerSession()
180 if (locale != null) { in newSpellCheckerSession()
183 if (subtypeLanguage.length() < 2 || !locale.getLanguage().equals(subtypeLanguage)) { in newSpellCheckerSession()
188 final String localeStr = locale.toString(); in newSpellCheckerSession()
197 locale.getLanguage().equals(tempSubtypeLanguage)) { in newSpellCheckerSession()
DSpellCheckerSubtype.java82 public SpellCheckerSubtype(int nameId, String locale, String languageTag, String extraValue, in SpellCheckerSubtype() argument
85 mSubtypeLocale = locale != null ? locale : ""; in SpellCheckerSubtype()
104 public SpellCheckerSubtype(int nameId, String locale, String extraValue) { in SpellCheckerSubtype() argument
105 this(nameId, locale, SUBTYPE_LANGUAGE_TAG_NONE, extraValue, SUBTYPE_ID_NONE); in SpellCheckerSubtype()
246 final Locale locale = getLocaleObject(); in getDisplayName() local
247 final String localeStr = locale != null ? locale.getDisplayName() : mSubtypeLocale; in getDisplayName()
287 private static int hashCodeInternal(String locale, String extraValue) { in hashCodeInternal() argument
288 return Arrays.hashCode(new Object[] {locale, extraValue}); in hashCodeInternal()
/frameworks/base/core/java/android/provider/
DUserDictionary.java139 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/base/core/java/android/os/
DLocaleList.java85 public int indexOf(Locale locale) { in indexOf() argument
87 if (mList[i].equals(locale)) { in indexOf()
279 private static String getLikelyScript(Locale locale) { in getLikelyScript() argument
280 final String script = locale.getScript(); in getLikelyScript()
285 return ULocale.addLikelySubtags(ULocale.forLocale(locale)).getScript(); in getLikelyScript()
295 private static boolean isPseudoLocale(String locale) { in isPseudoLocale() argument
296 return STRING_EN_XA.equals(locale) || STRING_AR_XB.equals(locale); in isPseudoLocale()
303 public static boolean isPseudoLocale(Locale locale) { in isPseudoLocale() argument
304 return LOCALE_EN_XA.equals(locale) || LOCALE_AR_XB.equals(locale); in isPseudoLocale()
310 public static boolean isPseudoLocale(@Nullable ULocale locale) { in isPseudoLocale() argument
[all …]
/frameworks/layoutlib/bridge/src/libcore/icu/
DICU_Delegate.java48 /*package*/ static String getCurrencyCode(String locale) { in getCurrencyCode() argument
53 /*package*/ static String getISO3Country(String locale) { in getISO3Country() argument
58 /*package*/ static String getISO3Language(String locale) { in getISO3Language() argument
63 /*package*/ static String getScript(String locale) { in getScript() argument
78 /*package*/ static boolean initLocaleDataNative(String locale, LocaleData result) { in initLocaleDataNative() argument
144 /*package*/ static void setDefaultLocale(String locale) { in setDefaultLocale() argument
145 ICU.setDefaultLocale(locale); in setDefaultLocale()
/frameworks/base/media/java/android/media/voice/
DKeyphraseModelManager.java84 @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()

12345678