Package com.ibm.icu.impl
Class LocaleIDs
- java.lang.Object
-
- com.ibm.icu.impl.LocaleIDs
-
public class LocaleIDs extends Object
Utilities for mapping between old and new language, country, and other locale ID related names.
-
-
Constructor Summary
Constructors Constructor Description LocaleIDs()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetCurrentCountryID(String oldID)static StringgetCurrentLanguageID(String oldID)static StringgetISO3Country(String country)Returns a three-letter abbreviation for the provided country.static StringgetISO3Language(String language)Returns a three-letter abbreviation for the language.static String[]getISOCountries()Returns a list of all 2-letter country codes defined in ISO 3166.static String[]getISOLanguages()Returns a list of all 2-letter language codes defined in ISO 639 plus additional 3-letter codes determined to be useful for locale generation as defined by Unicode CLDR.static StringthreeToTwoLetterLanguage(String lang)static StringthreeToTwoLetterRegion(String region)
-
-
-
Method Detail
-
getISOCountries
public static String[] getISOCountries()
Returns a list of all 2-letter country codes defined in ISO 3166. Can be used to create Locales.
-
getISOLanguages
public static String[] getISOLanguages()
Returns a list of all 2-letter language codes defined in ISO 639 plus additional 3-letter codes determined to be useful for locale generation as defined by Unicode CLDR. Can be used to create Locales. [NOTE: ISO 639 is not a stable standard-- some languages' codes have changed. The list this function returns includes both the new and the old codes for the languages whose codes have changed.]
-
getISO3Country
public static String getISO3Country(String country)
Returns a three-letter abbreviation for the provided country. If the provided country is empty, returns the empty string. Otherwise, returns an uppercase ISO 3166 3-letter country code.- Throws:
MissingResourceException- Throws MissingResourceException if the three-letter country abbreviation is not available for this locale.
-
getISO3Language
public static String getISO3Language(String language)
Returns a three-letter abbreviation for the language. If language is empty, returns the empty string. Otherwise, returns a lowercase ISO 639-2/T language code. The ISO 639-2 language codes can be found on-line atftp://dkuug.dk/i18n/iso-639-2.txt- Throws:
MissingResourceException- Throws MissingResourceException if the three-letter language abbreviation is not available for this locale.
-
-