Core/src/main/java/org/openestate/io/core/LocaleUtils.java
public static String translateCountryName(String country, Locale language) {
        country = StringUtils.trimToNull(country);
        if (country == null) return null;
        for (String iso2Code : Locale.getISOCountries()) {
            Locale countryLocale = new Locale(iso2Code, iso2Code);
            for (Locale translationLocale : LocaleUtils.availableLocaleList()) {
                String name = StringUtils.trimToNull(countryLocale.getDisplayCountry(translationLocale));
                if (name != null && name.equalsIgnoreCase(country)) {
                    name = StringUtils.trimToNull(countryLocale.getDisplayCountry(language));
                    if (name != null) return name;
                }
            }
        }
        return null;
    }
public static String translateCountryName(String country, Locale language) {
        country = StringUtils.trimToNull(country);
        if (country == null) return null;
        for (String iso2Code : Locale.getISOCountries()) {
            Locale countryLocale = new Locale(iso2Code, iso2Code);
            for (Locale translationLocale : LocaleUtils.availableLocaleList()) {
                String name = StringUtils.trimToNull(countryLocale.getDisplayCountry(translationLocale));
                if (name != null && name.equalsIgnoreCase(country)) {
                    name = StringUtils.trimToNull(countryLocale.getDisplayCountry(language));
                    if (name != null) return name;
                }
            }
        }
        return null;
    }
public static String translateCountryName ( String country , Locale language ) { country = StringUtils . trimToNull ( country ) ; if ( country == null ) return null ; for ( String iso2Code : Locale . getISOCountries ( ) ) { Locale countryLocale = new Locale ( iso2Code , iso2Code ) ; for ( Locale translationLocale : LocaleUtils . availableLocaleList ( ) ) { String name = StringUtils . trimToNull ( countryLocale . getDisplayCountry ( translationLocale ) ) ; if ( name != null && name . equalsIgnoreCase ( country ) ) { name = StringUtils . trimToNull ( countryLocale . getDisplayCountry ( language ) ) ; if ( name != null ) return name ; } } } return null ; }
Translate a country name into another language.

@param country  country name
@param language language to translate
@return translated country name or null, if no translation was found
Translate a country name into another language .