android判断当前系统的语言
来源:互联网 发布:win7优化精简教程 编辑:程序博客网 时间:2024/05/16 14:21
判断国家:
中文:getResources().getConfiguration().locale.getCountry().equals("CN")
繁体中文: getResources().getConfiguration().locale.getCountry().equals("TW")
英文(英式):getResources().getConfiguration().locale.getCountry().equals("UK")
英文(美式):getResources().getConfiguration().locale.getCountry().equals("US")
如果不清楚当前国家的简写,可以直接System.out(getResources().getConfiguration().locale.getCountry());打印出来即可
下面是判断是否是中文或者繁体中文(台湾):
- public boolean isLunarSetting() {
- String language = getLanguageEnv();
- if (language != null
- && (language.trim().equals("zh-CN") || language.trim().equals("zh-TW")))
- return true;
- else
- return false;
- }
- private String getLanguageEnv() {
- Locale l = Locale.getDefault();
- String language = l.getLanguage();
- String country = l.getCountry().toLowerCase();
- if ("zh".equals(language)) {
- if ("cn".equals(country)) {
- language = "zh-CN";
- } else if ("tw".equals(country)) {
- language = "zh-TW";
- }
- } else if ("pt".equals(language)) {
- if ("br".equals(country)) {
- language = "pt-BR";
- } else if ("pt".equals(country)) {
- language = "pt-PT";
- }
- }
- return language;
- }
0 0
- android判断当前系统的语言
- Android判断当前系统使用的语言
- Android 判断当前系统语言
- Android判断当前系统语言
- Android 判断当前系统语言
- Android 判断当前系统语言
- Android 判断当前系统语言
- Android 判断当前系统语言
- android判断当前系统用的是什么语言
- android判断当前系统用的是什么语言
- android判断当前系统用的是什么语言
- Android判断国家以及系统当前的语言
- android判断当前系统版本的等级
- iOS判断当前系统语言
- 如何判断当前系统语言
- Android开发实用技巧:判断当前系统语言版本
- Android--获取当前系统的语言环境
- Android--获取当前系统的语言环境
- GetKeyState()和GetAsyncKeyState()的区别
- MySQL 常用维护命令
- 如何将android studio项目转换成eclipse
- 2049: [Sdoi2008]Cave 洞穴勘测
- 关于导入GPUimage到工程以及简单使用
- android判断当前系统的语言
- poj2251 三维bfs求最短距离
- 2015河南科技学院高校CSDN俱乐部--excel讲解
- MySQL 常用管理工具
- Caused by: java.lang.IllegalArgumentException: Illegal character in scheme at index 0:
- python实践——批量统计mongodb数据库的集合大小
- 路由器与交换机
- Linux Memory Mapping
- 安装11G数据库脚本