feat(framework): add language preference setting #3680
All Vouch review confidence checks passed
Residual risk 0.28 = Change Risk (0.52) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #3680"
general
weight: 0.35
h-kataria
Summary
Adds a user preference for selecting the interface language. The selected language is persisted per user, applied immediately through the existing i18n setup, and can be reset to browser-detected language. Language options display native names alongside English names and are sorted by English name for consistent discoverability.
Type of Change
Risk Analysis - REQUIRED
Dependencies
None.
Testing
Ephemeral E2E Tests
Once PR is ready and preliminary checks pass, trigger tests by posting a comment
/run-playwrighton this PR.External Server E2E Runs
Not applicable.
Manual Testing
Page Settings Language Manual Verification
##### 1. Default language follows browser
1. Set the browser preferred language to English.
2. Open the application in a fresh/incognito window.
3. Navigate to User preferences → Language.
4. Confirm Follow browser is selected.
5. Confirm the UI is in English.
6. In DevTools:
-
localStorage.getItem('lang')should benull.- The
langcookie should be absent or empty.##### 2. Language options order and divider
1. Open User preferences → Language.
2. Open the language dropdown.
3. Confirm Follow browser is the first option.
4. Confirm a divider appears immediately below it.
5. Confirm all explicit languages appear below the divider.
6. Confirm the explicit languages retain their configured order:
- Chinese
- Dutch
- English
- French
- Japanese
- Korean
- Spanish
##### 3. Select an explicit language
1. Select French.
2. Save the preferences.
3. Confirm the UI text changes to French.
4. Confirm the document language in DevTools:
It should be
fr.5. Confirm the language cache:
It should be
fr.6. Confirm the selected preference is persisted in:
It should be
fr.##### 4. Explicit language persists after reload
1. With French selected, reload the page.
2. Confirm the UI remains in French.
3. Reopen User preferences.
4. Confirm the language selection is still French.
5. Confirm
document.documentElement.langremainsfr.##### 5. Return to browser language
1. Set the browser preferred language to English.
2. In the application, select Follow browser.
3. Save the preferences.
4. Confirm the UI changes from French back to English without requiring a reload.
5. Confirm:
is
en.6. Confirm the language cache was cleared:
should be
null.7. Confirm the language cookie is cleared:
should not contain a
lang=...entry.##### 6. Browser preference is restored after reload
1. After selecting Follow browser, reload the page.
2. Confirm the UI remains English.
3. Confirm Follow browser remains selected.
4. Confirm no stale French language cache or cookie is recreated.
##### 7. Non-English browser preference
1. Change the browser preferred language to Spanish or Japanese.
2. Select Follow browser in the application.
3. Confirm the UI switches to the browser language.
4. Confirm
document.documentElement.langmatches the resolved language.5. Reload the page and confirm the browser language remains active.
##### 8. Browser language with regional locale
1. Set the browser language to a regional locale such as
en-USorfr-CA.2. Select Follow browser.
3. Confirm the application resolves it to the supported base language (
enorfr) rather than failing to load translations.4. Confirm the UI and
document.documentElement.languse the resolved supported language.##### 9. Query-string override regression check
1. Open the application with a language query parameter, for example:
2. Confirm French is loaded because the query string has higher detection priority.
3. Select Follow browser and save.
4. Confirm the query-string override behavior remains consistent with the application's intended precedence.
##### 10. Invalid or stale preference recovery
1. In DevTools, set an invalid preference:
2. Reload the page.
3. Confirm the application treats the Page Settings preference as Follow browser.
4. Confirm the stale
langcache is cleared.5. Confirm the UI follows the browser language.
Screenshots
<img width="1263" height="372" alt="image" src="https://github.com/user-attachments/assets/faeab6a1-76c9-4f7c-8b67-e686c617926c" />