| java.lang.Object com.ibm.icu.impl.LocaleUtility
LocaleUtility | public class LocaleUtility (Code) | | A class to hold utility functions missing from java.util.Locale.
|
Method Summary | |
public static String | canonicalLocaleString(Locale locale) | public static String | canonicalLocaleString(String id) You'd think that Locale canonicalizes, since it munges the
renamed languages, but it doesn't quite. | public static Locale | fallback(Locale loc) Fallback from the given locale name by removing the rightmost _-delimited
element. | public static Locale | getLocaleFromName(String name) A helper function to convert a string of the form
aa_BB_CC to a locale object. | public 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 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). |
canonicalLocaleString | public static String canonicalLocaleString(Locale locale)(Code) | | Convenience method that calls canonicalLocaleString(String) with
locale.toString();
|
canonicalLocaleString | public static String canonicalLocaleString(String id)(Code) | | You'd think that Locale canonicalizes, since it munges the
renamed languages, but it doesn't quite. It forces the region
to be upper case but doesn't do anything about the language or
variant. Our canonical form is 'lower_UPPER_UPPER'.
|
fallback | public static Locale fallback(Locale loc)(Code) | | Fallback from the given locale name by removing the rightmost _-delimited
element. If there is none, return the root locale ("", "", ""). If this
is the root locale, return null. NOTE: The string "root" is not
recognized; do not use it.
a new Locale that is a fallback from the given locale, or null. |
getLocaleFromName | public static Locale getLocaleFromName(String name)(Code) | | A helper function to convert a string of the form
aa_BB_CC to a locale object. Why isn't this in Locale?
|
isFallbackOf | public static boolean isFallbackOf(String parent, String child)(Code) | | 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).
|
isFallbackOf | public static boolean isFallbackOf(Locale parent, Locale child)(Code) | | Compare two locales, and return true if the parent is a
'strict' fallback of the child (parent string is a fallback
of child string).
|
|
|