Home | History | Annotate | Download | only in icu

Lines Matching defs:Locale

21 import java.util.Locale;
25 * Passes locale-specific from ICU native code to Java.
32 // A cache for the locale-specific data.
35 // Ensure that we pull in the locale data for the root locale, en_US, and the
36 // user's default locale. (All devices must support the root locale and en_US,
39 get(Locale.ROOT);
40 get(Locale.US);
41 get(Locale.getDefault());
117 public static Locale mapInvalidAndNullLocales(Locale locale) {
118 if (locale == null) {
119 return Locale.getDefault();
122 if ("und".equals(locale.toLanguageTag())) {
123 return Locale.ROOT;
126 return locale;
130 * Returns a shared LocaleData for the given locale.
132 public static LocaleData get(Locale locale) {
133 if (locale == null) {
134 throw new NullPointerException("locale == null");
137 final String languageTag = locale.toLanguageTag();
144 LocaleData newLocaleData = initLocaleData(locale);
197 private static LocaleData initLocaleData(Locale locale) {
199 if (!ICU.initLocaleDataNative(locale.toLanguageTag(), localeData)) {
200 throw new AssertionError("couldn't initialize LocaleData for locale " + locale);
204 localeData.timeFormat_hm = ICU.getBestDateTimePattern("hm", locale);
205 localeData.timeFormat_Hm = ICU.getBestDateTimePattern("Hm", locale);
206 localeData.timeFormat_hms = ICU.getBestDateTimePattern("hms", locale);
207 localeData.timeFormat_Hms = ICU.getBestDateTimePattern("Hms", locale);