Fix follow-system app language to use primary locale#13546
Closed
wizdom13 wants to merge 1 commit into
Closed
Conversation
Contributor
|
Please fill in the template and exlain what is actually fixed. |
Author
Thanks, I updated the PR description and filled in the template. I also added a clearer explanation of what was fixed and linked it to #13107. |
Isira-Seneviratne
requested changes
May 29, 2026
Comment on lines
+66
to
73
| final String tag; | ||
| if (systemLang.equals(language)) { | ||
| final Locale systemLocale = LocaleListCompat.getAdjustedDefault().get(0); | ||
| tag = (systemLocale == null ? Locale.getDefault() : systemLocale).toLanguageTag(); | ||
| } else { | ||
| tag = language; | ||
| } | ||
| AppCompatDelegate.setApplicationLocales(LocaleListCompat.forLanguageTags(tag)); |
Member
There was a problem hiding this comment.
Suggested change
| final String tag; | |
| if (systemLang.equals(language)) { | |
| final Locale systemLocale = LocaleListCompat.getAdjustedDefault().get(0); | |
| tag = (systemLocale == null ? Locale.getDefault() : systemLocale).toLanguageTag(); | |
| } else { | |
| tag = language; | |
| } | |
| AppCompatDelegate.setApplicationLocales(LocaleListCompat.forLanguageTags(tag)); | |
| if (systemLang.equals(language)) { | |
| AppCompatDelegate.setApplicationLocales(LocaleListCompat.getAdjustedDefault()); | |
| } else { | |
| AppCompatDelegate.setApplicationLocales(LocaleListCompat.forLanguageTags(language)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is it?
refactorbranchDescription of the changes in your PR
Fixes inconsistent/mixed UI language behavior when Android has multiple system languages configured and NewPipe is set to use the default/system app language.
The issue was reported in #13107. For example, when Android system languages are configured as:
some NewPipe UI strings could appear in Japanese even though the primary system language is English.
This PR fixes the locale handling so that NewPipe uses the intended primary/default app locale consistently instead of mixing strings from a secondary system language.
Changed area:
app/src/main/java/org/schabi/newpipe/settings/ContentSettingsFragment.javaWhat is actually fixed?
Before this change, NewPipe could show UI strings from multiple languages when the app language was set to default/follow system and Android had more than one system language configured.
After this change, NewPipe consistently uses the expected app/system UI language. If English (US) is the primary Android language and Japanese is secondary, NewPipe UI remains in English instead of randomly mixing English and Japanese strings.
Fixes the following issue(s)
Fixes #13107
APK testing
Tested manually with the following language configurations:
Checked:
Before/After Screenshots/Screen Record
Before:
After:
Due diligence