|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.xmlmind.util.LocaleUtil
public final class LocaleUtil
A collection of utility functions (static methods) operating on Locales.
| Method Summary | |
|---|---|
static java.lang.String |
getIndividualLanguageCode(java.util.Locale locale)
Returns the lowercase ISO 639 code corresponding to the individual language of the specified locale. |
static java.util.Locale |
getLocale(java.lang.String lang)
Returns the Locale corresponding to specified language. |
static java.lang.String |
normalizeLang(java.lang.String lang)
Equivalent to normalizeLang(lang, null). |
static java.lang.String |
normalizeLang(java.lang.String lang,
java.lang.String[] parts)
Returns a normalized, possibly simplified, version of specified language. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.util.Locale getLocale(java.lang.String lang)
lang - specifies the language:
a two-letter ISO language code as defined by ISO-639,
possibly followed by a two-letter ISO Country Code
as defined by ISO-3166. Examples: "en", "en-US", "fr", "fr-CA".
NumberFormat.getInstance().public static java.lang.String normalizeLang(java.lang.String lang)
normalizeLang(lang, null).
public static java.lang.String normalizeLang(java.lang.String lang,
java.lang.String[] parts)
lang - a language code preferably matching pattern
[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*parts - returns lower_case_language in the first element
of this array and upper_case_country or null in
its second element. May be null.
public static java.lang.String getIndividualLanguageCode(java.util.Locale locale)
For example, returns nn for no-NO-NY because no is just a macrolanguage and not an actual individual language.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||