Fix chinese picker issue

This commit is contained in:
stom79 2018-12-15 11:17:03 +01:00
parent 54363e5573
commit 22e293ebf7
1 changed files with 7 additions and 1 deletions

View File

@ -54,7 +54,13 @@ public class MainApplication extends MultiDexApplication {
List<Locale> SUPPORTED_LOCALES = new ArrayList<>();
SharedPreferences sharedpreferences = getSharedPreferences(Helper.APP_PREFS, android.content.Context.MODE_PRIVATE);
String defaultLocaleString = sharedpreferences.getString(Helper.SET_DEFAULT_LOCALE_NEW, Helper.getDefaultLocale());
Locale defaultLocale = new Locale(defaultLocaleString);
Locale defaultLocale;
if( defaultLocaleString.equals("zh-CN"))
defaultLocale = Locale.SIMPLIFIED_CHINESE;
else if( defaultLocaleString.equals("zh-TW"))
defaultLocale = Locale.TRADITIONAL_CHINESE;
else
defaultLocale = new Locale(defaultLocaleString);
SUPPORTED_LOCALES.add(defaultLocale);
LocaleChanger.initialize(getApplicationContext(), SUPPORTED_LOCALES);
}catch (Exception ignored){ignored.printStackTrace();}