public class LocaleUtils extends Object
Modifier and Type | Field and Description |
---|---|
static Locale |
CHINESE_SIMPLIFIED
Locale used for simplified chinese.
|
static Locale |
CHINESE_TRADITIONAL
Locale used for traditional chinese.
|
static String |
ISO_639_1_ALBANIAN |
static String |
ISO_639_1_ARABIC |
static String |
ISO_639_1_AZERBAIJANI
Azerbaijani (az)
|
static String |
ISO_639_1_BENGALI
Bengali (bn)
|
static String |
ISO_639_1_BOSNIAN
Bosnian (bs) locale
|
static String |
ISO_639_1_BULGARIAN |
static String |
ISO_639_1_CATALAN |
static String |
ISO_639_1_CHINESE
The Chinese locale (zh)
|
static String |
ISO_639_1_CHINESE_SIMPLIFIED
Chinese, Simplified (zh_SC)
|
static String |
ISO_639_1_CHINESE_TRADITIONAL
Chinese, Traditional (zh_TC)
|
static String |
ISO_639_1_CROATIAN
Croatian locale
|
static String |
ISO_639_1_CZECH
Czech (cs) locale
|
static String |
ISO_639_1_DANISH
The Danish locale (da)
|
static String |
ISO_639_1_DUTCH
The Dutch locale (nl)
|
static String |
ISO_639_1_ENGLISH
The English locale (en)
|
static String |
ISO_639_1_ESTONIAN
Estonian (et) locale
|
static String |
ISO_639_1_FARSI
Farsi (fa) locale
|
static String |
ISO_639_1_FINNISH
The Finnish locale (fi)
|
static String |
ISO_639_1_FRENCH
The French locale (fr)
|
static String |
ISO_639_1_GERMAN
The German locale (de)
|
static String |
ISO_639_1_GREEK
GReek (el) locale
|
static String |
ISO_639_1_HEBREW
The Hebrew locale (he) NOTE: Java normalizes this to "iw"!
|
static String |
ISO_639_1_HINDI
Hindi (hi)
|
static String |
ISO_639_1_HUNGARIAN
Hungarian (hu) locale
|
static String |
ISO_639_1_INDONESIAN
Indonesian (id) locale
|
static String |
ISO_639_1_ITALIAN
The Italian locale (it)
|
static String |
ISO_639_1_JAPANESE
Japanese (ja) locale
|
static String |
ISO_639_1_KANNDA
Kannda (kn)
|
static String |
ISO_639_1_KAZAKH
Kazakh (kk)
|
static String |
ISO_639_1_KHMER
Khmer (km)
|
static String |
ISO_639_1_KOREAN
The Korean locale (ko)
|
static String |
ISO_639_1_LATVIAN
LATVIAN (lv) locale
|
static String |
ISO_639_1_LITHUANIAN
Lithuanian (lt)
|
static String |
ISO_639_1_MACEDONIAN
Macedonian (mk)
|
static String |
ISO_639_1_MALAY
Malay (ms) locale
|
static String |
ISO_639_1_NORWEGIAN
The Norwegian locale (no)
|
static String |
ISO_639_1_POLISH
Polish (pl) locale
|
static String |
ISO_639_1_PORTUGUESE
The Portuguese locale (pt)
|
static String |
ISO_639_1_ROMANIAN
Romanian (ro) locale
|
static String |
ISO_639_1_RUSSIAN
The Russian locale (ru)
|
static String |
ISO_639_1_SERBIAN
Serbian (sr) locale
|
static String |
ISO_639_1_SLOVAK
Slovak (sk) locale
|
static String |
ISO_639_1_SLOVENIAN
Slovenian (sl) locale
|
static String |
ISO_639_1_SPANISH
The Spanish locale (es)
|
static String |
ISO_639_1_SWEDISH
The Swedish locale (sv)
|
static String |
ISO_639_1_TAMIL
Tamil (ta)
|
static String |
ISO_639_1_TELUGU
Telugu (te)
|
static String |
ISO_639_1_THAI
The Thai locale (th)
|
static String |
ISO_639_1_TURKISH
The Turkish locale (tr)
|
static String |
ISO_639_1_UKRAINIAN
Ukrainian (uk) locale
|
static String |
ISO_639_1_URDU
Urdu (ur) locale
|
static String |
ISO_639_1_VIETNAMESE
Vietnamese (vi) locale
|
Constructor and Description |
---|
LocaleUtils() |
Modifier and Type | Method and Description |
---|---|
static Locale |
getDefaultLocale(LocaleAware... localeSearchArray)
Gets the default locale.
|
static Locale |
getLocale(Locale defaultLocale,
LocaleAware... localeSearchArray)
Get the Locale from a list of objects, trying them in order.
|
static List<Locale> |
getLocaleList()
Gets the locale list for defined constants
|
static List<Locale> |
getSortedLocaleList()
Gets the sorted locale list by simple compare
|
static List<Locale> |
getSortedLocaleListByLanguage()
Gets the sorted locale list by display language.
|
static Locale[] |
getSupportedLocales() |
static boolean |
isSupported(Locale locale) |
static boolean |
isValidLocale(Locale locale)
Returns true if this Locale object is valid.
|
static boolean |
languageEquals(String a,
String b)
Returns true if the two language codes are equal.
|
static Locale |
parseLocale(Object locale)
Parses a locale from an Object.
|
static Locale |
parseLocale(String locale)
Parses a locale from a String.
|
static Locale |
toLocale(String locale,
Locale defaultValue)
Convert a string to a Locale (return defaultValue if parsing fails)
|
public static final String ISO_639_1_ENGLISH
public static final String ISO_639_1_CHINESE
public static final String ISO_639_1_DUTCH
public static final String ISO_639_1_DANISH
public static final String ISO_639_1_FINNISH
public static final String ISO_639_1_FRENCH
public static final String ISO_639_1_GERMAN
public static final String ISO_639_1_HEBREW
public static final String ISO_639_1_ITALIAN
public static final String ISO_639_1_KOREAN
public static final String ISO_639_1_NORWEGIAN
public static final String ISO_639_1_PORTUGUESE
public static final String ISO_639_1_RUSSIAN
public static final String ISO_639_1_SPANISH
public static final String ISO_639_1_SWEDISH
public static final String ISO_639_1_THAI
public static final String ISO_639_1_TURKISH
public static final String ISO_639_1_ARABIC
public static final String ISO_639_1_ALBANIAN
public static final String ISO_639_1_BULGARIAN
public static final String ISO_639_1_CATALAN
public static final String ISO_639_1_CHINESE_TRADITIONAL
public static final String ISO_639_1_CHINESE_SIMPLIFIED
public static final Locale CHINESE_TRADITIONAL
public static final Locale CHINESE_SIMPLIFIED
public static final String ISO_639_1_CROATIAN
public static final String ISO_639_1_CZECH
public static final String ISO_639_1_ESTONIAN
public static final String ISO_639_1_FARSI
public static final String ISO_639_1_GREEK
public static final String ISO_639_1_HUNGARIAN
public static final String ISO_639_1_INDONESIAN
public static final String ISO_639_1_JAPANESE
public static final String ISO_639_1_LATVIAN
public static final String ISO_639_1_MALAY
public static final String ISO_639_1_POLISH
public static final String ISO_639_1_ROMANIAN
public static final String ISO_639_1_SERBIAN
public static final String ISO_639_1_SLOVAK
public static final String ISO_639_1_SLOVENIAN
public static final String ISO_639_1_UKRAINIAN
public static final String ISO_639_1_URDU
public static final String ISO_639_1_VIETNAMESE
public static final String ISO_639_1_BOSNIAN
public static final String ISO_639_1_AZERBAIJANI
public static final String ISO_639_1_KAZAKH
public static final String ISO_639_1_MACEDONIAN
public static final String ISO_639_1_LITHUANIAN
public static final String ISO_639_1_BENGALI
public static final String ISO_639_1_KHMER
public static final String ISO_639_1_HINDI
public static final String ISO_639_1_KANNDA
public static final String ISO_639_1_TAMIL
public static final String ISO_639_1_TELUGU
public static boolean isSupported(Locale locale)
public static Locale[] getSupportedLocales()
public static boolean languageEquals(String a, String b)
a
- the first language codeb
- the second language codepublic static Locale toLocale(String locale, Locale defaultValue)
public static Locale parseLocale(Object locale)
locale
- the localepublic static Locale parseLocale(String locale)
locale
- the locale stringpublic static boolean isValidLocale(Locale locale)
locale
- the localepublic static Locale getDefaultLocale(LocaleAware... localeSearchArray)
localeSearchArray
- the locale search arraypublic static Locale getLocale(Locale defaultLocale, LocaleAware... localeSearchArray)
defaultLocale
- the default localelocaleSearchArray
- the locale search arraypublic static List<Locale> getLocaleList()
public static List<Locale> getSortedLocaleListByLanguage()
Copyright © 2018 Attivio, Inc. All Rights Reserved.
PATENT NOTICE: Attivio, Inc. Software Related Patents. With respect to the Attivio software product(s) being used, the following patents apply: Querying Joined Data Within A Search Engine Index: United States Patent No.(s): 8,073,840. Ordered Processing of Groups of Messages: U.S. Patent No.(s) 8,495,656. Signal processing approach to sentiment analysis for entities in documents: U.S. Patent No.(s) 8,725,494. Other U.S. and International Patents Pending.