/** * tries to get local (JVM language) COUNTRY name for given parameters/variants * * @param countries * all possible names or iso codes * @return localized country name, or first country param 1:1 if we cannot translate */ public static String getLocalizedCountry(String... countries) { return getLocalizedCountryForLanguage(Locale.getDefault().getLanguage(), countries); }
/** * tries to get localized COUNTRY name (in given language) for given parameters/variants * * @param countries * all possible names or iso codes * @return localized country name, or first country param 1:1 if we cannot translate */ public static String getLocalizedCountryForLanguage(String language, String... countries) { // KEY_TO_LOCALE_MAP is correct here, we want to get the language locale!!! return getLocalizedCountryForLanguage(KEY_TO_LOCALE_MAP.get(language.toLowerCase(Locale.ROOT)), countries); }
if (ImdbMetadataProvider.providerInfo.getConfig().getValueAsBool("scrapeLanguageNames")) { md.addCountry( LanguageUtils.getLocalizedCountryForLanguage(options.getLanguage().getLanguage(), countryElement.text(), matcher.group(1)));
md.addCountry(LanguageUtils.getLocalizedCountryForLanguage(options.getLanguage(), country));
md.addCountry(LanguageUtils.getLocalizedCountryForLanguage(options.getLanguage(), country.name, country.iso_3166_1));