Skip to content

Commit 26af421

Browse files
Properly handle when system language is selected
1 parent abd9aad commit 26af421

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ public void onCreatePreferences(final Bundle savedInstanceState, final String ro
5353
} else {
5454
appLanguagePref.setOnPreferenceChangeListener((preference, newValue) -> {
5555
final String language = (String) newValue;
56-
final Locale locale = Locale.forLanguageTag(language);
57-
AppCompatDelegate.setApplicationLocales(LocaleListCompat.create(locale));
56+
final String systemLang = getString(R.string.default_localization_key);
57+
final var locales = systemLang.equals(language)
58+
? LocaleListCompat.getEmptyLocaleList()
59+
: LocaleListCompat.forLanguageTags(language);
60+
AppCompatDelegate.setApplicationLocales(locales);
5861
return true;
5962
});
6063
}

0 commit comments

Comments
 (0)