public class LocaleUtility extends Object
| Constructor and Description |
|---|
LocaleUtility() |
| Modifier and Type | Method and Description |
|---|---|
static Locale |
fallback(Locale loc)
Fallback from the given locale name by removing the rightmost _-delimited
element.
|
static Locale |
getLocaleFromName(String name)
A helper function to convert a string of the form
aa_BB_CC to a locale object.
|
static boolean |
isFallbackOf(Locale parent,
Locale child)
Compare two locales, and return true if the parent is a
'strict' fallback of the child (parent string is a fallback
of child string).
|
static boolean |
isFallbackOf(String parent,
String child)
Compare two locale strings of the form aa_BB_CC, and
return true if parent is a 'strict' fallback of child, that is,
if child =~ "^parent(_.+)*" (roughly).
|
public static Locale getLocaleFromName(String name)
public static boolean isFallbackOf(String parent, String child)
public static boolean isFallbackOf(Locale parent, Locale child)
public static Locale fallback(Locale loc)