Try to get language up and work

This commit is contained in:
khanhduytran0 2020-11-21 17:35:12 +07:00
parent 63d9d29a87
commit 746aeea4c5
3 changed files with 8 additions and 6 deletions

View File

@ -8,7 +8,7 @@ public class DisplayableLocale {
private static Locale processStringLocale(String locale) { private static Locale processStringLocale(String locale) {
if (locale.contains("-")) { if (locale.contains("-")) {
String[] split = locale.split("-"); String[] split = locale.split("-");
return new Locale(split[0], split[1]); return new Locale(split[0] /*, split[1] */);
} else { } else {
return new Locale(locale); return new Locale(locale);
} }

View File

@ -45,7 +45,7 @@ public class PojavLoginActivity extends BaseActivity
private SharedPreferences firstLaunchPrefs; private SharedPreferences firstLaunchPrefs;
private boolean isSkipInit = false; private static boolean isSkipInit = false;
// private final String PREF_IS_DONOTSHOWAGAIN_WARN = "isWarnDoNotShowAgain"; // private final String PREF_IS_DONOTSHOWAGAIN_WARN = "isWarnDoNotShowAgain";
public static final String PREF_IS_INSTALLED_JAVARUNTIME = "isJavaRuntimeInstalled"; public static final String PREF_IS_INSTALLED_JAVARUNTIME = "isJavaRuntimeInstalled";
@ -69,8 +69,6 @@ public class PojavLoginActivity extends BaseActivity
firstLaunchPrefs = getSharedPreferences("pojav_extract", MODE_PRIVATE); firstLaunchPrefs = getSharedPreferences("pojav_extract", MODE_PRIVATE);
new InitTask().execute(isSkipInit); new InitTask().execute(isSkipInit);
isSkipInit = true;
} }
private class InitTask extends AsyncTask<Boolean, String, Integer>{ private class InitTask extends AsyncTask<Boolean, String, Integer>{
@ -280,6 +278,8 @@ public class PojavLoginActivity extends BaseActivity
edit3.setEnabled(!p2); edit3.setEnabled(!p2);
} }
}); });
isSkipInit = true;
} }
@Override @Override

View File

@ -19,11 +19,13 @@ public class LocaleUtils {
LauncherPreferences.loadPreferences(); LauncherPreferences.loadPreferences();
} }
Locale locale;
if (LauncherPreferences.PREF_LANGUAGE.equals("default")) { if (LauncherPreferences.PREF_LANGUAGE.equals("default")) {
return context; locale = DEFAULT_LOCALE;
} else {
locale = new Locale(LauncherPreferences.PREF_LANGUAGE);
} }
Locale locale = new Locale(LauncherPreferences.PREF_LANGUAGE);
Locale.setDefault(locale); Locale.setDefault(locale);
Resources res = context.getResources(); Resources res = context.getResources();