Make <code>get</code> locale-aware.
169107
@Override
    public HelpModule get(String key) {
        key = HelpModule.getLocalizedId(key, Localizer.getDefaultLocale());
        
        while (!key.isEmpty()) {
            HelpModule helpModule = super.get(key);
            
            if (helpModule != null) {
                return helpModule;
            }
            
            int i = key.lastIndexOf('_');
            key = i < 0 ? "" : key.substring(0, i);
        }
        
        return null;
    }
314797
private void initializeLocale() {
        final String locale = getProperty(LOCALE, applicationProperties);
        if (locale != null && !"".equals(locale)) {
            final String[] localeParts = locale.split("_");
            if (localeParts.length == 2) {
                currentLocale = new Locale(localeParts[0], localeParts[1]);
            } else {
                currentLocale = new Locale(localeParts[0]);
            }
        } else {
            currentLocale = Locale.getDefault();
        }
        logger.info(Messages.getMessage(CONTEXT_LOCALE_USED), currentLocale);
    }
319901
public Translation get(String locale) {
        locale = locale.replace("-", "_");
        Translation tr = translations.get(locale);
        if (locale.contains("_") && tr == null)
            tr = translations.get(locale.substring(0, 2));

        return tr;
    }
1236687
public Iterable<Di18n> queryByLocale(java.lang.String locale) {
    return queryByField(null, Di18nMapper.Field.LOCALE.getFieldName(), locale);
  }
597447
@Override
    public Enumeration<Locale> getLocales() {
        ServletRESTRequestImpl ret = castRequest();
        if (ret != null)
            return ret.getLocales();
        return null;
    }
249352
public void addLocale(String locale) {

        m_searchObject.setLocale(locale);
        m_searchObjectChanged = true;
        ValueChangeEvent.fire(this, m_searchObject);
    }
1114214
public <T> T getField(String locale, String key) {
    return localize(locale).getField(key);
  }
567268
def select_locale_by_request(self, request, locales=()):
        """"""
        default_locale = locales and locales[0] or self.cfg.default_locale

        if len(locales) == 1 or 'ACCEPT-LANGUAGE' not in request.headers:
            return default_locale

        ulocales = [
            (q, locale_delim_re.split(v)[0])
            for v, q in parse_accept_header(request.headers['ACCEPT-LANGUAGE'])
        ]
        ulocales.sort()
        ulocales.reverse()

        for locale in locales:
            for _, ulocale in ulocales:
                ulocale = locale_delim_re.split(ulocale)[0]
                if ulocale.lower() == locale.lower():
                    return ulocale

        return ulocales[0][1]
107334
private Locale getUserLocale(IPerson user) {
        // get user locale
        Locale[] locales = localeStore.getUserLocales(user);
        LocaleManager localeManager =
                localeManagerFactory.createLocaleManager(user, Arrays.asList(locales));
        return localeManager.getLocales().get(0);
    }
946512
function resolveLocale(locales) {
	const localesFingerprint = locales.toString()
	if (resolvedLocales[localesFingerprint]) {
		return resolvedLocales[localesFingerprint] 
	}
	return resolvedLocales[localesFingerprint] = intlDateTimeFormatSupportedLocale(locales)
}
227916
Set<Locale> getImplLocales(Class<?> c10nInterface) {
        Set<Locale> res = new HashSet<Locale>();
        C10NImplementationBinder<?> binder = binders.get(c10nInterface);
        if (binder != null) {
            res.addAll(binder.bindings.keySet());
        }
        return res;
    }
339536
public CLDR.Locale minimize(CLDR.Locale locale) {
    return languageResolver.removeLikelySubtags((MetaLocale)locale);
  }
1032831
public static Locale getLocaleToBeUsed(final UiProperties.Localization localizationProperties,
            final Locale desiredLocale) {
        final List<String> availableLocals = localizationProperties.getAvailableLocals();
        // ckeck if language code of UI locale matches an available local.
        // Country, region and variant are ignored. "availableLocals" must only
        // contain language codes without country or other extensions.
        if (availableLocals.contains(desiredLocale.getLanguage())) {
            return desiredLocale;
        }
        return new Locale(localizationProperties.getDefaultLocal());
    }
1132182
@SuppressWarnings({"unchecked"})
    public static <T extends LocalizableResource> T get(Class<T> cls, String locale) {
        Map<String, LocalizableResource> localeCache = getLocaleCache(cls);
        T m = (T) localeCache.get(locale);
        if (m != null) {
            return m;
        }
        synchronized (cache) {
            m = (T) localeCache.get(locale);
            if (m != null) {
                return m;
            }
            m = provider.create(cls, locale);
            put(cls, locale, m);
            return m;
        }
    }
877328
private ResourceBundle getBundle(Locale locale) {
        return ResourceBundle.getBundle(bundleName, locale, loader, new UTF8Control());
    }
1226126
@Override
    public List<Locale> getLocales(String acceptLangHdr) {
        // Short circuit with an empty enumeration if null header
        if (null == acceptLangHdr) {
            List<Locale> def = new ArrayList<Locale>(1);
            def.add(Locale.getDefault());
            return def;
        }

        // Check cache
        List<Locale> langList = this.localesCache.get(acceptLangHdr);
        if (null == langList) {
            // Create and add to cache
            List<List<String>> rc = processAcceptLanguage(acceptLangHdr);
            if (null != rc) {
                langList = extractLocales(rc);
                this.localesCache.put(acceptLangHdr, langList);
            } else {
                // this can happen with only q=0 values in the header
                List<Locale> def = new ArrayList<Locale>(1);
                def.add(Locale.getDefault());
                return def;
            }
        }

        return langList;
    }
688482
def get(cls, code: str) -> "Locale":
        
        if code not in cls._cache:
            assert code in _supported_locales
            translations = _translations.get(code, None)
            if translations is None:
                locale = CSVLocale(code, {})  # type: Locale
            elif _use_gettext:
                locale = GettextLocale(code, translations)
            else:
                locale = CSVLocale(code, translations)
            cls._cache[code] = locale
        return cls._cache[code]