Commit d83a4d2
For v30: Fix base language preferred over regional variant in auto-detection 🌐 (#3506)
## Description:
When the browser reports a locale like `de-DE`, the language selector
didn't find an exact match and fell through to candidate matching, where
it picked `de-CH` (Swiss German) over `de` (German) because longer codes
were sorted first.
This adds an early check: if the base language code (e.g. `de`) is
directly supported, return it immediately before scanning regional
candidates.
FYI @Aotumuri
## Please complete the following:
- [X] I have added screenshots for all UI updates
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file
- [X] I have added relevant tests to the test directory
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
## Please put your Discord username so you can be contacted if a bug or
regression is found:
FloPinguin1 parent 39ad547 commit d83a4d2
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
0 commit comments