update
This commit is contained in:
@@ -62,7 +62,7 @@ public class IMLoginManager extends BaseCacheManager {
|
||||
language = "zh";
|
||||
}
|
||||
if (!getBoolean(KEY_LANGUAGE, !TextUtils.equals(language, "zh"))) {
|
||||
return Locale.SIMPLIFIED_CHINESE;
|
||||
return Locale.TRADITIONAL_CHINESE;
|
||||
} else {
|
||||
return new Locale("en", "rUS");
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ToastUtil {
|
||||
|
||||
|
||||
public static void show(int res) {
|
||||
show(WordUtil.getString(res));
|
||||
show(WordUtil.getNewString(res));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.yunbao.common.utils;
|
||||
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
@@ -26,6 +27,16 @@ public class WordUtil {
|
||||
return sResources.getString(res);
|
||||
}
|
||||
|
||||
public static String getNewString(int res) {
|
||||
Configuration config = new Configuration();
|
||||
Configuration tmp = sResources.getConfiguration();
|
||||
config.setToDefaults();
|
||||
config.locale = IMLoginManager.get(CommonAppContext.sInstance).getLocaleLanguage();
|
||||
sResources.updateConfiguration(config, sResources.getDisplayMetrics());
|
||||
String str = sResources.getString(res);
|
||||
sResources.updateConfiguration(tmp, sResources.getDisplayMetrics());
|
||||
return str;
|
||||
}
|
||||
public static boolean isZh() {
|
||||
Locale locale = sResources.getConfiguration().locale;
|
||||
String language = locale.getLanguage();
|
||||
|
||||
Reference in New Issue
Block a user