Returns a calendar formatter for the given locale, translating it before lookup.
542806
public CalendarFormatter getCalendarFormatter(CLDR.Locale locale) {
    locale = bundleMatch(locale);
    CalendarFormatter formatter = CALENDAR_FORMATTERS.get(locale);
    return formatter == null ? CALENDAR_FORMATTERS.get(CLDR.Locale.en_US) : formatter;
  }
732928
public static CalendarText getInstance(
        Chronology<?> chronology,
        Locale locale
    ) {

        return getInstance(extractCalendarType(chronology), locale);

    }
1285375
public static String selectJavaDateTimeFormatFromMomentJSFormatOrDefault(Locale locale, String momentJSFormat, boolean withDate, boolean withTime) {
		if (momentJSFormat == null) {
			String dateFormat = "";
			if (withDate) {
				dateFormat = ((SimpleDateFormat) DateFormat.getDateInstance(DateFormat.SHORT, locale)).toPattern();
			}
			String timeFormat = "";
			if (withTime) {
				timeFormat = ((SimpleDateFormat)DateFormat.getTimeInstance(DateFormat.MEDIUM, locale)).toPattern();
			}
			// Since DateFormat.SHORT is silly, return a smart format
			if (dateFormat.equals("M/d/yy")) {
				dateFormat = "MM/dd/yyyy";
			}
			else if (dateFormat.equals("d/M/yy")) {
				dateFormat = "dd/MM/yyyy";
			}
			return (dateFormat + " " + timeFormat).trim();
		} else {
			return LocaleUtils.momentToJavaFormat(momentJSFormat);
		}
	}
1238031
def slang_date(self, locale="en"):
        "
        dt = pendulum.instance(self.datetime())

        try:
            return _translate(dt, locale)
        except KeyError:
            pass

        delta = humanize.time.abs_timedelta(
            timedelta(seconds=(self.epoch - now().epoch)))

        format_string = "DD MMM"
        if delta.days >= 365:
            format_string += " YYYY"

        return dt.format(format_string, locale=locale).title()
1031903
@Override
  public String formatDateTime(Locale locale, Date date) {
    return DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.SHORT, locale).format(date);
  }
1265455
public static Builder in (TimeZone zone, Locale locale)
    {
        return with(Calendar.getInstance(zone, locale));
    }
1210352
private Strategy getLocaleSpecificStrategy(final int field, final Calendar definingCalendar) {
		final ConcurrentMap<Locale, Strategy> cache = getCache(field);
		Strategy strategy = cache.get(locale);
		if (strategy == null) {
			strategy = field == Calendar.ZONE_OFFSET ? new TimeZoneStrategy(locale) : new CaseInsensitiveTextStrategy(field, definingCalendar, locale);
			final Strategy inCache = cache.putIfAbsent(locale, strategy);
			if (inCache != null) {
				return inCache;
			}
		}
		return strategy;
	}
1102996
private static Map<String, Integer> getMonthNames(Locale locale) {
		Map<String, Integer> r = MONTH_NAMES_CACHE.get(locale);
		if (r == null) {
			DateFormatSymbols symbols = DateFormatSymbols.getInstance(locale);
			r = new HashMap<>(24);
			
			//insert long month names
			String[] months = symbols.getMonths();
			for (int i = 0; i < months.length; ++i) {
				String m = months[i];
				if (!m.isEmpty()) {
					r.put(m.toUpperCase(), i + 1);
				}
			}
			
			//insert short month names
			String[] shortMonths = symbols.getShortMonths();
			for (int i = 0; i < shortMonths.length; ++i) {
				String m = shortMonths[i];
				if (!m.isEmpty()) {
					r.put(m.toUpperCase(), i + 1);
				}
			}
			MONTH_NAMES_CACHE.put(locale, r);
		}
		
		return r;
	}
368974
public Calendar toCalendar(TimeZone zone, Locale locale) {
		if (null == locale) {
			locale = Locale.getDefault(Locale.Category.FORMAT);
		}
		final Calendar cal = (null != zone) ? Calendar.getInstance(zone, locale) : Calendar.getInstance(locale);
		cal.setFirstDayOfWeek(firstDayOfWeek.getValue());
		cal.setTime(this);
		return cal;
	}
513353
function getCurrencySymbol(code, format, locale) {
    if (locale === void 0) { locale = 'en'; }
    var currency = getLocaleCurrencies(locale)[code] || CURRENCIES_EN[code] || [];
    var symbolNarrow = currency[1 /* SymbolNarrow */];
    if (format === 'narrow' && typeof symbolNarrow === 'string') {
        return symbolNarrow;
    }
    return currency[0 /* Symbol */] || code;
}
836061
public static function formatLocale($locale)
    {
        if (\is_string($locale)) {
            $locale = strtolower($locale);
            $locale = str_replace('-', '_', $locale);
        }

        return $locale;
    }
129335
protected function getFormatterDay($locale) {
		if (! isset($this->formattersDay[$locale])) {
			$this->formattersDay[$locale] = new IntlDateFormatter($locale, IntlDateFormatter::MEDIUM, IntlDateFormatter::NONE);
		}
		
		return $this->formattersDay[$locale];
	}
24971
public static ArrayList<DateTimeFormatter> getExtraTimeParsingFormatsForLocale(Locale locale) {
        // Create some variables that we will need.
        String language = locale.getLanguage();
        String[] definedFormats = null;

        // Get the list of extra parsing formats for the language of the locale.
        if ("en".equals(language)) {
            definedFormats = extraParsingFormatsForLanguage_en;
        }

        // If no extra parsing formats were found, then return an empty list.
        ArrayList<DateTimeFormatter> extraParsingFormatters = new ArrayList<DateTimeFormatter>();
        if (definedFormats == null) {
            return extraParsingFormatters;
        }

        // Create the parsing formatters from the defined formats, and add them to the results list.
        DateTimeFormatter formatter;
        for (String formatString : definedFormats) {
            formatter = new DateTimeFormatterBuilder().parseLenient().parseCaseInsensitive().
                    appendPattern(formatString).toFormatter(locale);
            extraParsingFormatters.add(formatter);
        }

        // Return the results.
        return extraParsingFormatters;
    }
115498
protected function & getIntlDatetimeFormatter ($langAndLocale = NULL, $dateType = NULL, $timeType = NULL, $timeZone = NULL, $calendar = NULL) {
		$key = implode('_', [
			'datetime',
			serialize(func_get_args())
		]);
		if (!isset($this->intlFormatters[$key])) {
			$this->intlFormatters[$key] = \datefmt_create(
				$this->langAndLocale, $dateType, $timeType, $timeZone, $calendar
			);
		}
		return $this->intlFormatters[$key];
	}
505942
function localeFormat (d, format) {
        var tokens = format.match(/(%E.|%O.|%.)/g);

        for (var i = 0; tokens && i < tokens.length; i++) {
            var value = '';

            // http://pubs.opengroup.org/onlinepubs/007908799/xsh/strftime.html
            switch (tokens[i]) {
            // localized day/month names
            case '%a':
                value = _('weekday-' + d.getDay() + '-short');
                break;
            case '%A':
                value = _('weekday-' + d.getDay() + '-long');
                break;
            case '%b':
            case '%h':
                value = _('month-' + d.getMonth() + '-short');
                break;
            case '%B':
                value = _('month-' + d.getMonth() + '-long');
                break;
            case '%Eb':
                value = _('month-' + d.getMonth() + '-genitive');
                break;

            // like %H, but in 12-hour format and without any leading zero
            case '%I':
                value = d.getHours() % 12 || 12;
                break;

            // like %d, without any leading zero
            case '%e':
                value = d.getDate();
                break;

            // %p: 12 hours format (AM/PM)
            case '%p':
                value = d.getHours() < 12 ? _('time_am') : _('time_pm');
                break;

            // localized date/time strings
            case '%c':
            case '%x':
            case '%X':
            // ensure the localized format string doesn't contain any %c|%x|%X
                var tmp = _('dateTimeFormat_' + tokens[i]);
                if (tmp && !(/(%c|%x|%X)/).test(tmp)) {
                    value = localeFormat(d, tmp);
                }
                break;

            // other tokens don't require any localization
            }

            format = format.replace(tokens[i], value || d.toLocaleFormat(tokens[i]));
        }

        return format;
    }
583248
private static DateFormatSymbols getCachedInstance(Locale locale) {
        SoftReference<DateFormatSymbols> ref = cachedInstances.get(locale);
        DateFormatSymbols dfs = null;
        if (ref == null || (dfs = ref.get()) == null) {
            dfs = new DateFormatSymbols(locale);
            ref = new SoftReference<DateFormatSymbols>(dfs);
            SoftReference<DateFormatSymbols> x = cachedInstances.putIfAbsent(locale, ref);
            if (x != null) {
                DateFormatSymbols y = x.get();
                if (y != null) {
                    dfs = y;
                } else {
                    // Replace the empty SoftReference with ref.
                    cachedInstances.put(locale, ref);
                }
            }
        }
        return dfs;
    }
250118
protected function getFormatter($locale) {
		if (! isset($this->formatters[$locale])) {
			$this->formatters[$locale] = new NumberFormatter($locale, NumberFormatter::CURRENCY);
		}
		
		return $this->formatters[$locale];
	}