This commit is contained in:
2023-10-10 00:35:38 +08:00
parent 2bdc95b3b5
commit 676aba70e7
27 changed files with 1368 additions and 117 deletions

View File

@@ -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");
}

View File

@@ -43,7 +43,7 @@ public class ToastUtil {
public static void show(int res) {
show(WordUtil.getString(res));
show(WordUtil.getNewString(res));
}
/**

View File

@@ -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();