Eras for the Gregorian calendar (e.g. AD/BC).

\@experimental i18n support is experimental.
@param {?} locale
@param {?} width
@return {?}
321138
function getLocaleEraNames(locale, width) {
    var /** @type {?} */ data = findLocaleData(locale);
    var /** @type {?} */ erasData = /** @type {?} */ (data[7 /* Eras */]);
    return getLastDefinedValue(erasData, width);
}
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;
    }
1267487
private static Calendar getInstanceInternal(TimeZone tz, ULocale locale) {
        if (locale == null) {
            locale = ULocale.getDefault(Category.FORMAT);
        }
        if (tz == null) {
            tz = TimeZone.getDefault();
        }

        Calendar cal = createInstance(locale);
        cal.setTimeZone(tz);
        cal.setTimeInMillis(System.currentTimeMillis());
        return cal;
    }
287149
public static String retrieveFieldValueName(String id, int field, int value, int style,
            Locale locale) {
        // Android-changed: delegate to ICU.
        if (field == Calendar.ERA) {
            // For era the field value does not always equal the index into the names array.
            switch (normalizeCalendarType(id)) {
                // These calendars have only one era, but represented it by the value 1.
                case BUDDHIST_CALENDAR:
                case ISLAMIC_CALENDAR:
                    value -= 1;
                    break;
                case JAPANESE_CALENDAR:
                    // CLDR contains full data for historical eras, java.time only supports the 4
                    // modern eras and numbers the modern eras starting with 1 (MEIJI). There are
                    // 232 historical eras in CLDR/ICU so to get the real offset, we add 231.
                    value += 231;
                    break;
                default:
                    // Other eras use 0-based values (e.g. 0=BCE, 1=CE for gregorian).
                    break;
            }
        }
        if (value < 0) {
            return null;
        }
        String[] names = getNames(id, field, style, locale);
        if (value >= names.length) {
            return null;
        }
        return names[value];
    }
233553
def timeago_template(locale, index, ago_in):
    '''
    
    '''
    try:
        LOCALE = __import__('timeago.locales.' + locale)
        LOCALE = locale_module(LOCALE, locale)
    except:
        locale = setting.DEFAULT_LOCALE
        LOCALE = __import__('timeago.locales.' + locale)
        LOCALE = locale_module(LOCALE, locale)

    if isinstance(LOCALE, list):
        return LOCALE[index][ago_in]
    else:
        return LOCALE(index, ago_in)
29135
private static PeriodFormatter buildWordBased(Locale locale) {
        ResourceBundle b = ResourceBundle.getBundle(BUNDLE_NAME, locale);
        if (containsKey(b, "PeriodFormat.regex.separator")) {
            return buildRegExFormatter(b, locale);
        } else {
            return buildNonRegExFormatter(b, locale);
        }
    }
1123088
def get_east_asian_width_property(value, is_bytes=False):
    """"""

    obj = unidata.ascii_east_asian_width if is_bytes else unidata.unicode_east_asian_width

    if value.startswith('^'):
        negated = value[1:]
        value = '^' + unidata.unicode_alias['eastasianwidth'].get(negated, negated)
    else:
        value = unidata.unicode_alias['eastasianwidth'].get(value, value)

    return obj[value]
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;
	}
391551
function (calendar) {
            var time = calendar.getTime();
            calendar = /**@type {KISSY.Date.Gregorian}
         @ignore*/
            new GregorianCalendar(this.timezoneOffset, this.locale);
            calendar.setTime(time);
            var i, ret = [], pattern = this.pattern, len = pattern.length;
            for (i = 0; i < len; i++) {
                var comp = pattern[i];
                if (comp.text) {
                    ret.push(comp.text);
                } else if ('field' in comp) {
                    ret.push(formatField(comp.field, comp.count, this.locale, calendar));
                }
            }
            return ret.join('');
        }
67015
public Era getEra(final Locale locale) {
        
        if(locale == null) {
            return Era.UNKNOWN_ERA;
        }
        
        if(eras.containsKey(locale)) {
            return eras.get(locale);
        }
        
        MessageResource resource = messageResolver.loadResource(locale);
        
        // 該当する時代情報の定義のメッセージプロパティが存在するか。
        final Era era;
        if(resource.isNullObject()) {
            era = Era.UNKNOWN_ERA;
        } else {
            era = createEra(resource);
        }
        
        eras.put(locale, era);
        
        return era;
        
    }
1044101
function(type, args, obj) {
        this.Locale[type.toUpperCase()] = args[0];

        this.cfg.refireEvent(DEF_CFG.LOCALE_MONTHS.key);
        this.cfg.refireEvent(DEF_CFG.LOCALE_WEEKDAYS.key);
    }
746753
public Era getEra(final MSLocale locale) {
        return locale == null ? Era.UNKNOWN_ERA : getEra(locale.getLocale());
    }
902358
function formatTime(lang, input) {
	var result = input;
	var matches;
	var localeTimeString;

	while ((matches = TIME_REGEX.exec(input)) != null) {

		var date = new Date(Date.parse(matches[1]));
		localeTimeString = date.toLocaleTimeString(lang,
			{
				hour: 'numeric',
				minute: '2-digit'
			});

		result = result.replace(matches[0], localeTimeString);
	};
	return result;
}
521074
function(date, format) {
            var i, replacements,
                locale = locale_name();
            if(format && locale_uses_day_before_month()) {
                replacements = this.DAY_FIRST_FORMATS;
                for(i = 0; i < replacements.length; i++) {
                    format = format.replace(replacements[i][0], replacements[i][1]);
                }
            }
            if(format && locale in this.CUSTOM_LOCALE_FORMATS) {
                replacements = this.CUSTOM_LOCALE_FORMATS[locale];

                for(i = 0; i < replacements.length; i++) {
                    format = format.replace(replacements[i][0], replacements[i][1]);
                }
            }
            return format_date(date, format);
        }
495956
function(opts, day, abbr)
    {
        day += opts.firstDay;
        while (day >= 7) {
            day -= 7;
        }
        return abbr ? opts.i18n.weekdaysShort[day] : opts.i18n.weekdays[day];
    }
247733
public static String selectDateFormat(Locale locale, String format) {
		String selFormat;
		if (format == null) {
			selFormat = ((SimpleDateFormat) DateFormat.getDateInstance(DateFormat.SHORT, locale)).toPattern();
			// Since DateFormat.SHORT is silly, return a smart format
			if (selFormat.equals("M/d/yy")) {
				return "MM/dd/yyyy";
			}
			if (selFormat.equals("d/M/yy")) {
				return "dd/MM/yyyy";
			}
		} else {
			selFormat = format;
		}

		return selFormat;
	}
929534
public void setLocale(Locale locale) {
        mLocale = locale;
        mWeekStart = Calendar.getInstance(mTimezone, mLocale).getFirstDayOfWeek();
        YEAR_FORMAT = new SimpleDateFormat("yyyy", locale);
        MONTH_FORMAT = new SimpleDateFormat("MMM", locale);
        DAY_FORMAT = new SimpleDateFormat("dd", locale);
    }