clear Languages pref when using System Default
Keeps things clean if System Default clears out the pref entirely.
This commit is contained in:
parent
5febedebd6
commit
2586e87524
@ -120,6 +120,7 @@ public final class Languages {
|
|||||||
if (locale != null && TextUtils.equals(locale.getLanguage(), language) && (!refresh)) {
|
if (locale != null && TextUtils.equals(locale.getLanguage(), language) && (!refresh)) {
|
||||||
return; // already configured
|
return; // already configured
|
||||||
} else if (language == null || language.equals(USE_SYSTEM_DEFAULT)) {
|
} else if (language == null || language.equals(USE_SYSTEM_DEFAULT)) {
|
||||||
|
Preferences.get().clearLanguage();
|
||||||
locale = DEFAULT_LOCALE;
|
locale = DEFAULT_LOCALE;
|
||||||
} else {
|
} else {
|
||||||
/* handle locales with the country in it, i.e. zh_CN, zh_TW, etc */
|
/* handle locales with the country in it, i.e. zh_CN, zh_TW, etc */
|
||||||
|
@ -230,7 +230,11 @@ public final class Preferences implements SharedPreferences.OnSharedPreferenceCh
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getLanguage() {
|
public String getLanguage() {
|
||||||
return preferences.getString(Preferences.PREF_LANGUAGE, "");
|
return preferences.getString(Preferences.PREF_LANGUAGE, Languages.USE_SYSTEM_DEFAULT);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearLanguage() {
|
||||||
|
preferences.edit().remove(Preferences.PREF_LANGUAGE).apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getLocalRepoName() {
|
public String getLocalRepoName() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user