|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gedcomx.util.LocaleUtil
public class LocaleUtil
Class for helping to choose the "best" locale that is available, given a preferred locale (e.g., that is being used by a particular user at a web site) and a default locale (e.g., English). User: Randy Wilson Date: 7/31/2014 Time: 11:44 AM
| Constructor Summary | |
|---|---|
LocaleUtil()
|
|
| Method Summary | |
|---|---|
static TextValue |
findClosestLocale(Collection<TextValue> textValues,
Locale localeToMatch)
Return the textValue whose language is closest the localeToMatch. |
static TextValue |
findClosestLocale(Collection<TextValue> textValues,
Locale localeToMatch,
Locale defaultLocale)
Return the textValue whose language is closest the localeToMatch. |
static Locale |
findClosestLocale(Set<Locale> locales,
Locale localeToMatch)
|
static Locale |
findClosestLocale(Set<Locale> locales,
Locale localeToMatch,
Locale defaultLocale)
|
static Locale |
getSimpleLocale(String languageString)
Parse the given languageString (e.g., "en-us", "en-US", "en_us", "en_US") and create a Locale from it. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LocaleUtil()
| Method Detail |
|---|
public static TextValue findClosestLocale(Collection<TextValue> textValues,
Locale localeToMatch)
textValues - - Collection of TextValues, each with a value and a language.localeToMatch - - Preferred locale to match against.
public static TextValue findClosestLocale(Collection<TextValue> textValues,
Locale localeToMatch,
Locale defaultLocale)
textValues - - Collection of TextValues, each with a value and a language.localeToMatch - - Preferred locale to match against.defaultLocale - - Default locale to match against, if none are close to the preferred locale.
public static Locale findClosestLocale(Set<Locale> locales,
Locale localeToMatch)
public static Locale findClosestLocale(Set<Locale> locales,
Locale localeToMatch,
Locale defaultLocale)
public static Locale getSimpleLocale(String languageString)
languageString - - BCP47 or Java language string ("en", "en-us", "en_US", etc.)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||