本文整理汇总了Java中sun.util.locale.LocaleUtils类的典型用法代码示例。如果您正苦于以下问题:Java LocaleUtils类的具体用法?Java LocaleUtils怎么用?Java LocaleUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LocaleUtils类属于sun.util.locale包,在下文中一共展示了LocaleUtils类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCompatibilityExtensions
import sun.util.locale.LocaleUtils; //导入依赖的package包/类
private static LocaleExtensions getCompatibilityExtensions(String language,
String script,
String country,
String variant) {
LocaleExtensions extensions = null;
// Special cases for backward compatibility support
if (LocaleUtils.caseIgnoreMatch(language, "ja")
&& script.length() == 0
&& LocaleUtils.caseIgnoreMatch(country, "jp")
&& "JP".equals(variant)) {
// ja_JP_JP -> u-ca-japanese (calendar = japanese)
extensions = LocaleExtensions.CALENDAR_JAPANESE;
} else if (LocaleUtils.caseIgnoreMatch(language, "th")
&& script.length() == 0
&& LocaleUtils.caseIgnoreMatch(country, "th")
&& "TH".equals(variant)) {
// th_TH_TH -> u-nu-thai (numbersystem = thai)
extensions = LocaleExtensions.NUMBER_THAI;
}
return extensions;
}
示例2: convertOldISOCodes
import sun.util.locale.LocaleUtils; //导入依赖的package包/类
private static String convertOldISOCodes(String language) {
// we accept both the old and the new ISO codes for the languages whose ISO
// codes have changed, but we always store the OLD code, for backward compatibility
language = LocaleUtils.toLowerString(language).intern();
if (language == "he") {
return "iw";
} else if (language == "yi") {
return "ji";
} else if (language == "id") {
return "in";
} else {
return language;
}
}
示例3: isUnicodeExtensionKey
import sun.util.locale.LocaleUtils; //导入依赖的package包/类
private static boolean isUnicodeExtensionKey(String s) {
// 2alphanum
return (s.length() == 2) && LocaleUtils.isAlphaNumericString(s);
}