fix some missed cases of using langauge tag instead of locale string

string conversion was implicit, so a bit harder to find
fixes #469
This commit is contained in:
Helium314 2024-02-01 19:46:44 +01:00
parent faf75963a8
commit 27f2492edd
4 changed files with 7 additions and 22 deletions

View file

@ -579,14 +579,14 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
public static void setSecondaryLocales(final SharedPreferences prefs, final Locale mainLocale, final List<Locale> locales) {
if (locales.isEmpty()) {
prefs.edit().putString(PREF_SECONDARY_LOCALES_PREFIX + mainLocale, "").apply();
prefs.edit().putString(PREF_SECONDARY_LOCALES_PREFIX + mainLocale.toLanguageTag(), "").apply();
return;
}
final StringBuilder sb = new StringBuilder();
for (Locale locale : locales) {
sb.append(";").append(locale.toLanguageTag());
}
prefs.edit().putString(PREF_SECONDARY_LOCALES_PREFIX + mainLocale, sb.toString()).apply();
prefs.edit().putString(PREF_SECONDARY_LOCALES_PREFIX + mainLocale.toLanguageTag(), sb.toString()).apply();
}
public static Colors getColorsForCurrentTheme(final Context context, final SharedPreferences prefs) {