You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(desktop): System default keeps the app UI and native menus in the same language - #46060
On packaged desktop with Language set to System default, the app window can stay in English while the native menus are translated. The renderer picked its catalog from navigator.languages, which the packaged Chromium pins to en-US first (see DesktopBridge.getPreferredSystemLanguages in packages/contracts/src/ipc.ts). Desktop main's applyLanguage resolves the menus from Electron's app.getPreferredSystemLanguages() instead, so the two disagree.
Deterministic repro on origin/main (95a3ec546411b62869d36a8f45ae2eaf91ddb769): run the real apps/web/src/i18n/runtime.ts (startI18n(), then await whenLocaleReady()) with saved language: "system", navigator.languages = ["en-US","fr-FR","fr","fr"], and window.desktopBridge.getPreferredSystemLanguages = () => ["fr-FR","fr"]. Only the settings store, the GT SPA initializer, and the catalog fetch are shimmed. The fetch returns the real fr.json.
Observed: {"rendererLocale":"en","documentLang":"","catalogEntries":0}. Desktop main's resolveLocale with the same OS list picks fr for the menus.
Expected: {"rendererLocale":"fr","documentLang":"fr", ...}. The window uses the same catalog as the native menus.
Change
resolveWebLocaleSelection now takes an optional OS language list and uses it for catalog selection when it is not empty. Otherwise it falls back to the browser list. The runtime passes desktopBridge.getPreferredSystemLanguages(), the list desktop main already uses. Explicit language settings, regional formatting, and browser/mobile clients that have no desktop bridge stay as they were.
Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
New case in apps/web/src/i18n/locales.test.ts (system follows the desktop OS languages over the pinned browser list). On base it fails with expected { catalogLocale: 'en', … } to deeply equal { catalogLocale: 'fr', … }. On head all 6 cases in the file pass.
Not shown: a run of the packaged Electron app on a non-English OS (no packaged build or localized OS in this environment); screenshots; mobile, which has no desktop bridge and is unchanged.
Authored by Claude Opus 5.5 (Model Hub); reviewed by GPT-6.2 Sol (Codex).
Not shown
apps/web/src/i18n/runtime.ts:67 — The transcript uses shimmed locale inputs and does not show the packaged app’s actual labels; add before/after captures of the same app label and native menu on a French-first OS when available.
apps/web/src/i18n/locales.test.ts:19 — The gist includes the proof harness but not the exact commands and setup for replaying it on both SHAs; add those instructions or a scenarios:prove recipe.
.github/pull_request_template.md:24 — The draft reports check:changed exit 0, but the linked evidence does not show the check output for af605f8a4d3f; attach the SHA and passing summary.
Macroscope's review found this PR requires human approval — System default will use OS language preferences so the desktop UI matches native menus, while retaining browser fallback. This changes the effective default language for affected desktop users and requires human review.
You can add or adjust custom eligibility rules. Learn more.
Reviewing files that changed from the base of the PR and between 87e8fa3 and 36e1e12.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
Locale resolution now accepts preferred desktop system languages. The runtime passes these languages when available. Tests cover system-language selection, fallback to browser languages when the system list is empty, and preservation of an explicitly selected locale.
Changes: Locale selection
Layer / File(s)
Summary
Locale resolution and runtime integration apps/web/src/i18n/locales.ts, apps/web/src/i18n/runtime.ts, apps/web/src/i18n/locales.test.ts
resolveWebLocaleSelection uses nonempty system locales instead of browser locales. The runtime supplies preferred desktop system languages when available. Tests cover empty system-language fallback and explicit locale selection.
With System default, the desktop app UI now follows the OS language list used by the native menus. Explicit language settings and browsers without a desktop bridge are unchanged. No merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the desktop fix: with System default, the app UI and native menus should use the same language. The raw summary confirms the change makes locale resolution use the OS language list (fr…
Description check
The description follows the repository template in substance. It has a Problem section with expected behavior and a reproduction on origin/main. It has a Change section that explains the fix and why t…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the desktop fix: with System default, the app UI and native menus should use the same language. The raw summary confirms the change makes locale resolution use the OS language list (from desktopBridge.getPreferredSystemLanguages) when it is nonempty, which matches the main change. The title uses the conventional commit form and is specific enough for a teammate scanning history.
Full details: Description check
Explanation
The description follows the repository template in substance. It has a Problem section with expected behavior and a reproduction on origin/main. It has a Change section that explains the fix and why the runtime passes the desktop bridge list. It has a Scope section that explains why no issue is needed for this small bug fix. It has a Verification section with a focused new test, base versus head results, and a runtime transcript. It also states what was not checked: a packaged Electron run on a non-English OS and screenshots. The template asks for screenshots for UI changes, and the author explains why none are shown. The review notes flag gaps in evidence: the transcript uses shimmed inputs, the replay commands are not in the gist, and the check:changed output is not linked for the exact head SHA. These gaps weaken verification but do not make the description largely incomplete.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Reviewing files that changed from the base of the PR and between 661a9ed and 87e8fa3.
Files selected for processing: 3
apps/web/src/i18n/locales.test.ts
apps/web/src/i18n/locales.ts
apps/web/src/i18n/runtime.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
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
size:S10-29 changed lines (additions + deletions).takeover:in-progressA takeover lead is working on this PRvouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
2 participants
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.
Problem
On packaged desktop with Language set to System default, the app window can stay in English while the native menus are translated. The renderer picked its catalog from
navigator.languages, which the packaged Chromium pins toen-USfirst (seeDesktopBridge.getPreferredSystemLanguagesinpackages/contracts/src/ipc.ts). Desktop main'sapplyLanguageresolves the menus from Electron'sapp.getPreferredSystemLanguages()instead, so the two disagree.Deterministic repro on
origin/main(95a3ec546411b62869d36a8f45ae2eaf91ddb769): run the realapps/web/src/i18n/runtime.ts(startI18n(), thenawait whenLocaleReady()) with savedlanguage: "system",navigator.languages = ["en-US","fr-FR","fr","fr"], andwindow.desktopBridge.getPreferredSystemLanguages = () => ["fr-FR","fr"]. Only the settings store, the GT SPA initializer, and the catalog fetch are shimmed. The fetch returns the realfr.json.{"rendererLocale":"en","documentLang":"","catalogEntries":0}. Desktop main'sresolveLocalewith the same OS list picksfrfor the menus.{"rendererLocale":"fr","documentLang":"fr", ...}. The window uses the same catalog as the native menus.Change
resolveWebLocaleSelectionnow takes an optional OS language list and uses it for catalog selection when it is not empty. Otherwise it falls back to the browser list. The runtime passesdesktopBridge.getPreferredSystemLanguages(), the list desktop main already uses. Explicit language settings, regional formatting, and browser/mobile clients that have no desktop bridge stay as they were.Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
apps/web/src/i18n/locales.test.ts(system follows the desktop OS languages over the pinned browser list). On base it fails withexpected { catalogLocale: 'en', … } to deeply equal { catalogLocale: 'fr', … }. On head all 6 cases in the file pass.runtime.tswith the inputs above. Base givesrendererLocale: "en"and head givesrendererLocale: "fr",documentLang: "fr"with the French catalog loaded: https://gist.github.com/saphid/59147b1157aba44b1e72f634fa13a6acvp run check:changedexited 0 (format, lint, knip, typecheck, tests, React Compiler).Not shown: a run of the packaged Electron app on a non-English OS (no packaged build or localized OS in this environment); screenshots; mobile, which has no desktop bridge and is unchanged.
Authored by Claude Opus 5.5 (Model Hub); reviewed by GPT-6.2 Sol (Codex).
Not shown