For v30: Fix base language preferred over regional variant in auto-detection 🌐#3506
For v30: Fix base language preferred over regional variant in auto-detection 🌐#3506
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…tection 🌐 (#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: FloPinguin
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 pickedde-CH(Swiss German) overde(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:
Please put your Discord username so you can be contacted if a bug or regression is found:
FloPinguin