Home | History | Annotate | Download | only in text

Lines Matching defs:locale

16 import java.util.Locale;
47 * // set the locale of time unit format
91 private ULocale locale;
127 * @param locale locale of this time unit formatter.
131 public TimeUnitFormat(ULocale locale) {
132 this(locale, FULL_NAME);
136 * Create TimeUnitFormat given a Locale, and using full name style.
137 * @param locale locale of this time unit formatter.
141 public TimeUnitFormat(Locale locale) {
142 this(locale, FULL_NAME);
147 * @param locale locale of this time unit formatter.
154 public TimeUnitFormat(ULocale locale, int style) {
159 locale, style == FULL_NAME ? FormatWidth.WIDE : FormatWidth.SHORT);
163 setLocale(locale, locale);
164 this.locale = locale;
168 private TimeUnitFormat(ULocale locale, int style, NumberFormat numberFormat) {
169 this(locale, style);
176 * Create TimeUnitFormat given a Locale and a formatting style.
180 public TimeUnitFormat(Locale locale, int style) {
181 this(ULocale.forLocale(locale), style);
185 * Set the locale used for formatting or parsing.
186 * @param locale locale of this time unit formatter.
191 public TimeUnitFormat setLocale(ULocale locale) {
192 if (locale != this.locale){
193 mf = mf.withLocale(locale);
196 setLocale(locale, locale);
197 this.locale = locale;
204 * Set the locale used for formatting or parsing.
205 * @param locale locale of this time unit formatter.
210 public TimeUnitFormat setLocale(Locale locale) {
211 return setLocale(ULocale.forLocale(locale));
227 if (locale == null) {
231 this.format = NumberFormat.getNumberInstance(locale);
347 if (locale == null) {
349 locale = format.getLocale(null);
351 locale = ULocale.getDefault(Category.FORMAT);
354 setLocale(locale, locale);
357 format = NumberFormat.getNumberInstance(locale);
359 pluralRules = PluralRules.forLocale(locale);
371 ULocale locale;
375 int style, Set<String> pluralKeywords, ULocale locale) {
379 this.locale = locale;
437 final MessageFormat messageFormat = new MessageFormat(pattern, locale);
451 ICUData.ICU_UNIT_BASE_NAME, locale);
454 timeUnitToCountToPatterns, style, pluralKeywords, locale);
462 // look for its unit pattern in its locale tree.
463 // if pattern is not found in its own locale, such as de_DE,
468 // look for the pattern of "other" in the locale tree:
480 // get all the patterns for each plural rule in this locale.
506 ULocale parentLocale = locale;
510 // look for pattern for srcPluralCount in locale tree
516 final MessageFormat messageFormat = new MessageFormat(pattern, locale);
528 // if no unitsShort resource was found even after fallback to root locale
543 messageFormat = new MessageFormat(DEFAULT_PATTERN_FOR_SECOND, locale);
545 messageFormat = new MessageFormat(DEFAULT_PATTERN_FOR_MINUTE, locale);
547 messageFormat = new MessageFormat(DEFAULT_PATTERN_FOR_HOUR, locale);
549 messageFormat = new MessageFormat(DEFAULT_PATTERN_FOR_WEEK, locale);
551 messageFormat = new MessageFormat(DEFAULT_PATTERN_FOR_DAY, locale);
553 messageFormat = new MessageFormat(DEFAULT_PATTERN_FOR_MONTH, locale);
555 messageFormat = new MessageFormat(DEFAULT_PATTERN_FOR_YEAR, locale);
625 return new TimeUnitFormat(locale, style, format);