当前位置: 首页>>代码示例>>Java>>正文


Java Locale.TRADITIONAL_CHINESE属性代码示例

本文整理汇总了Java中java.util.Locale.TRADITIONAL_CHINESE属性的典型用法代码示例。如果您正苦于以下问题:Java Locale.TRADITIONAL_CHINESE属性的具体用法?Java Locale.TRADITIONAL_CHINESE怎么用?Java Locale.TRADITIONAL_CHINESE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.util.Locale的用法示例。


在下文中一共展示了Locale.TRADITIONAL_CHINESE属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getLocale

/**
 * <pre>
 * 描述:获取本地语言
 * 作者:ZhangYi
 * 时间:2015年1月30日 下午1:24:06
 * 参数:(参数列表)
 * @param language
 * @return
 * </pre>
 */
public static Locale getLocale(String language) {
	Locale locale = Locale.CHINESE;
	if (!StringUtil.isEmpty(language)) {
		language = language.toLowerCase();
		if (language.indexOf("en") != -1) {
			locale = Locale.ENGLISH;
		}
		if (language.indexOf("zh_hk") != -1) {
			locale = Locale.TRADITIONAL_CHINESE;
		}
		if (language.indexOf("zh_cn") != -1) {
			locale = Locale.SIMPLIFIED_CHINESE;
		}
	}
	return locale;
}
 
开发者ID:dev-share,项目名称:database-transform-tool,代码行数:26,代码来源:ResourceHolder.java

示例2: invoke

public void invoke(PipelineContext pipelineContext) throws Exception {
    TurbineRunData rundata = getTurbineRunData(request);
    if (ignoreTarget(rundata.getTarget())) {
        pipelineContext.invokeNext();
        return;
    }

    //默认是中文
    String[] temp = rundata.getCookies().getStrings("locale");
    String locale = null;
    if (temp != null) {
        if (temp.length > 1) {
            locale = temp[temp.length - 1];
        } else if (temp.length == 1) {
            locale = temp[0];
        }
    }
    if (locale == null || "".equals(locale)) {
        locale = "zh";
    }

    Locale newLocale = Locale.SIMPLIFIED_CHINESE;
    if ("en".equals(locale)) {
        newLocale = Locale.ENGLISH;
    } else if ("zh".equals(locale)) {
        newLocale = Locale.SIMPLIFIED_CHINESE;
    } else if ("zh_TW".equals(locale)) {
        newLocale = Locale.TRADITIONAL_CHINESE;
    }
    LocaleUtil.setLocale(newLocale);

    pipelineContext.invokeNext();
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:33,代码来源:LocaleValve.java

示例3: getLocale

public static Locale getLocale(String language) {
	if ("en".equalsIgnoreCase(language)) {
    	return Locale.ENGLISH;
    } else if ("zh".equalsIgnoreCase(language)) {
    	return Locale.SIMPLIFIED_CHINESE;
    } else if ("zh_TW".equalsIgnoreCase(language)) {
    	return Locale.TRADITIONAL_CHINESE;
    }
    return Locale.getDefault();
}
 
开发者ID:dachengxi,项目名称:EatDubbo,代码行数:10,代码来源:LocaleUtils.java

示例4: getLanguageLocale

/**
 * 如果不是英文、简体中文、繁体中文,默认返回简体中文
 *
 * @return
 */
private Locale getLanguageLocale() {
    int languageType = CommSharedUtil.getInstance(mContext).getInt(MultiLanguageUtil.SAVE_LANGUAGE, 0);
    if (languageType == LanguageType.LANGUAGE_FOLLOW_SYSTEM) {
        Locale sysType = getSysLocale();
        if (sysType.equals(Locale.ENGLISH)) {
            return Locale.ENGLISH;
        } else if (sysType.equals(Locale.TRADITIONAL_CHINESE)) {
            return Locale.TRADITIONAL_CHINESE;
        } else if (TextUtils.equals(sysType.getLanguage(), Locale.CHINA.getLanguage())) { //zh
            if (TextUtils.equals(sysType.getCountry(), Locale.CHINA.getCountry())) {  //适配华为mate9  zh_CN_#Hans
                return Locale.SIMPLIFIED_CHINESE;
            }
        } else {
            return Locale.SIMPLIFIED_CHINESE;
        }
    } else if (languageType == LanguageType.LANGUAGE_EN) {
        return Locale.ENGLISH;
    } else if (languageType == LanguageType.LANGUAGE_CHINESE_SIMPLIFIED) {
        return Locale.SIMPLIFIED_CHINESE;
    } else if (languageType == LanguageType.LANGUAGE_CHINESE_TRADITIONAL) {
        return Locale.TRADITIONAL_CHINESE;
    }
    Log.e(TAG, "getLanguageLocale" + languageType + languageType);
    getSystemLanguage(getSysLocale());
    return Locale.SIMPLIFIED_CHINESE;
}
 
开发者ID:finddreams,项目名称:AndroidMultiLanguage,代码行数:31,代码来源:MultiLanguageUtil.java

示例5: isSharedFlyweight

private static boolean isSharedFlyweight(Object obj) {
    if (obj == null) {
        return true;
    }
    if (obj == Boolean.TRUE || obj == Boolean.FALSE) {
        return true;
    }
    if (/* obj == Locale.ROOT || *//* Java 6 */
    obj == Locale.ENGLISH || obj == Locale.FRENCH || obj == Locale.GERMAN || obj == Locale.ITALIAN
            || obj == Locale.JAPANESE || obj == Locale.KOREAN || obj == Locale.CHINESE
            || obj == Locale.SIMPLIFIED_CHINESE || obj == Locale.TRADITIONAL_CHINESE || obj == Locale.FRANCE
            || obj == Locale.GERMANY || obj == Locale.ITALY || obj == Locale.JAPAN || obj == Locale.KOREA
            || obj == Locale.CHINA || obj == Locale.PRC || obj == Locale.TAIWAN || obj == Locale.UK
            || obj == Locale.US || obj == Locale.CANADA || obj == Locale.CANADA_FRENCH) {
        return true;
    }
    if (obj == Collections.EMPTY_SET || obj == Collections.EMPTY_LIST || obj == Collections.EMPTY_MAP) {
        return true;
    }
    if (obj == BigInteger.ZERO || obj == BigInteger.ONE) {
        return true;
    }
    if (obj == System.in || obj == System.out || obj == System.err) {
        return true;
    }
    if (obj == String.CASE_INSENSITIVE_ORDER) {
        return true;
    }
    if (obj == JarFile.MANIFEST_NAME) {
        return true;
    }
    return false;
}
 
开发者ID:luoyaogui,项目名称:otter-G,代码行数:33,代码来源:ObjectProfiler.java

示例6: getLocale

private Locale getLocale(String localeName) {
    String language, country;
    int index;

    index = localeName.indexOf('_');
    if (index == -1) {
        //
        // Special case the builtin JDK languages
        //
        if (localeName.equals("de"))
            return Locale.GERMAN;
        if (localeName.equals("en"))
            return Locale.ENGLISH;
        if (localeName.equals("fr"))
            return Locale.FRENCH;
        if (localeName.equals("it"))
            return Locale.ITALIAN;
        if (localeName.equals("ja"))
            return Locale.JAPANESE;
        if (localeName.equals("ko"))
            return Locale.KOREAN;
        if (localeName.equals("zh"))
            return Locale.CHINESE;

        language = localeName;
        country = "";
    } else {
        if (localeName.equals("zh_CN"))
            return Locale.SIMPLIFIED_CHINESE;
        if (localeName.equals("zh_TW"))
            return Locale.TRADITIONAL_CHINESE;

        //
        // JDK also has constants for countries:  en_GB, en_US, en_CA,
        // fr_FR, fr_CA, de_DE, ja_JP, ko_KR.  We don't use those.
        //
        language = localeName.substring(0, index);
        country = localeName.substring(index + 1);
    }

    return new Locale(language, country);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:42,代码来源:MessageCatalog.java

示例7: getLocale

public static Locale getLocale(String language) {
    if ("en".equalsIgnoreCase(language)) {
        return Locale.ENGLISH;
    } else if ("zh".equalsIgnoreCase(language)) {
        return Locale.SIMPLIFIED_CHINESE;
    } else if ("zh_TW".equalsIgnoreCase(language)) {
        return Locale.TRADITIONAL_CHINESE;
    }
    return Locale.getDefault();
}
 
开发者ID:l1325169021,项目名称:github-test,代码行数:10,代码来源:LocaleUtils.java


注:本文中的java.util.Locale.TRADITIONAL_CHINESE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。