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(i18n): translate the main-process startup and recovery dialogs - #34608
Supersedes #27065 (by @outof-place; their commits are kept, plus a merge of main and maintainer edits).
What was wrong: native dialogs from the main process (GPU safe-mode prompts, profile-state recovery/copy-choice/repair, "Saving stopped", "Orca could not start", local build switch) were always in English.
What changed
Original PR: those strings go through translateMain with stable keys. GPU dialog options are now built when the dialog opens, and the profile-state dialogs take translate as an injected dependency. translateMain also fills {{placeholders}} before i18n init.
Merged main and resolved the conflicts. Main's newer comment, imports and recovery title were kept.
Also localized the repair dialog that main added (chooseProfileStateRepair), including its section labels. CLI and log text that use the same labels stay in English.
The live-terminal count now uses liveTerminals_one / liveTerminals_other plural keys.
Added pt entries for every new key, and retranslated the changed recovery title.
Removed the test that pinned Spanish catalog strings. Kept the pre-init interpolation test (main-i18n-pre-init.test.ts).
Early dialogs (profile-state copy/repair/recovery, "Orca could not start", recovery-not-applied) can show before the settings store sets the language. They now first call prepareEarlyMainUiLanguage(), which uses the system language (same resolution as the "System" setting, via app.getPreferredSystemLanguages()). The persisted choice is not read there, because the store may be the thing that failed. Once a language has been set, it is kept, and normal startup still applies the user's setting. Before Electron is ready, the system language is read without being cached.
profile-state-startup-failure.ts prose is still in English. It is mostly CLI commands and paths, and it is also logged.
The GPU safe-graphics prompts, the profile-state recovery and write-failure
dialogs, the startup failure box and the local-build switch built their copy
from English literals, so they stayed English in every UI language. They now
read it through translateMain(), with entries in all six catalogs.
The GPU prompts built their options once at import; they now build them when
the dialog opens, so the language active at that moment applies.
Some of these dialogs can open before main i18n finishes initializing. Until
then translateMain() returned its fallback with {{placeholders}} unfilled; it
now fills them from the options, so the pre-init English copy stays correct.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…graph
The profile-state recovery dialogs imported translateMain directly. Their unit test runs in the Bun node-server suite, so that import pulled main-i18n, Electron's app and the renderer locale catalogs into the node-server build graph. config/scripts/node-server-change-scope.test.mjs forbids renderer files there, and the Bun build also failed on the duplicate "sessionNotRestored" key the es/fr/ja/ko/zh catalogs already carry.
The dialogs now take the translator as a dependency, like showMessageBox. src/main/index.ts passes translateMain; the dialog test passes an English translator that fills the {{time}} placeholder the way translateMain does before i18n loads.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
anti-slop's no-reflect-get flags the placeholder lookup in interpolateFallback. i18next's TOptions already carries a string index signature, so a typed `options[name]` read into `unknown` replaces Reflect.get with the same behaviour.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Resolve conflicts in main-i18n.ts, index.ts, profile-state-recovery-preflight.ts
and the recovery dialog test, keeping main's newer comment, imports, repair
dialog and recovery title. Locale catalogs were re-applied key by key onto main.
- Translate the profile repair dialog main added (chooseProfileStateRepair),
including its section labels; CLI and log callers keep English labels.
- Use liveTerminals_one/_other plural keys for the local-build terminal count.
- Retranslate the recovery-not-applied title after main changed its copy.
- Add pt catalog entries for every new key.
- Keep only the pre-init interpolation test; drop the test that pinned
Spanish catalog strings.
Co-authored-by: outof-place <[email protected]>
Main-process GPU, profile-state, local-build, and startup dialogs now use translation functions with English fallback text. Fallback interpolation handles available values before i18n initialization. Early language preparation and system-language detection support dialogs shown during startup. Locale catalogs add translations in English, Spanish, French, Japanese, Korean, Portuguese, and Simplified Chinese. The English runtime-required catalog adds live-terminal reconnection messages.
Priority: Normal
Severity of issue fixed: Medium
Merge Risk: Low · previous review 05ebc
Some recovery guidance may appear in English or the wrong language. Address these gaps or accept them before merging.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Description check
The description gives a detailed explanation of the problem, implementation, scope, and linked issue. However, it omits most required template sections, including Visual Proof, Testing results, AI Dis…
Complete the required template sections. Add visual proof or state N/A with a reason, document manual and automated testing with platforms and results, complete applicable disclosure and review sections, confirm cross-platform and compatibi…
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: translating main-process startup and recovery dialogs.
Linked Issues check
Issue #27064 requires the GPU safe-graphics, profile-state, startup-failure, and local-build dialogs to follow the UI language. English text must stay unchanged. Dialogs shown before i18n init must in…
Out of Scope Changes check
All production and catalog changes connect to the linked issue's dialogs or to their supporting behavior.
Docstring coverage is inconclusive: files from earlier reviews still need to be rechecked within the check's analysis limits. Not blocking.
Full details: Linked Issues check
Explanation
Issue #27064 requires the GPU safe-graphics, profile-state, startup-failure, and local-build dialogs to follow the UI language. English text must stay unchanged. Dialogs shown before i18n init must interpolate {{placeholders}}.
Evidence at the reviewed head:
GPU prompts: gpuFallbackRestartOptions() and gpuFallbackRecoveredLaunchOptions() build options through translateMain with English fallbacks.
Profile-state dialogs: ProfileStateDialogTranslate is required in the startup-recovery, copy-choice, and repair-choice deps. Titles, messages, buttons, and section labels use translation keys with English fallbacks. profileStateSectionLabels accepts an injected translator.
Recovery failure and write-failure dialogs (profile-state-recovery-preflight.ts, profile-state-write-failure.ts) use translateMain.
Startup failure title (main-process-preflight-failure.ts) uses the translated title.
Local-build switch (local-build-switch.ts) uses translateMain for labels, messages, and live-terminal plural keys.
Pre-init interpolation: translateMain calls interpolateFallback when not initialized. Null or undefined values keep the placeholder. main-i18n-pre-init.test.ts covers this.
Early dialogs call prepareEarlyMainUiLanguage(), which sets the system language once and logs a warning on failure.
Locale catalogs (en, es, fr, ja, ko, pt, zh) contain the new keys.
Residual gap, not a named requirement: profile-state-startup-failure.ts (formatProfileStateStartupFailure) still returns English prose. The PR states this is deliberate because the text holds CLI commands and paths and is also logged. The issue does not name these strings. The summaries do not confirm whether this prose reaches a user-visible dialog. If it does, that prose stays English, and the issue expectation is only partly met for that text.
All four named dialog groups and the pre-init placeholder requirement are covered by the reviewed code.
Full details: Out of Scope Changes check
Explanation
All production and catalog changes connect to the linked issue's dialogs or to their supporting behavior.
GPU prompt files, profile-state-section-labels.ts, profile-state-startup-recovery-dialog.ts, main-process-preflight-failure.ts, profile-state-recovery-preflight.ts, profile-state-write-failure.ts, and local-build-switch.ts convert the named dialog strings to translateMain or injected translators.
main-i18n.ts (prepareEarlyMainUiLanguage, pre-init interpolation) supports the requirement that early dialogs localize and show filled placeholders.
system-language.ts and system-language.test.ts let the pre-ready language read return a value without caching it. prepareEarlyMainUiLanguage depends on this read.
src/main/index.ts passes prepareEarlyMainUiLanguage and translateMain into the profile-state dialogs.
en-runtime-required.json and the locale catalogs hold keys for the new strings, including the live-terminal plural keys used by the local-build dialog.
Tests cover the pre-init interpolation and the dialog translation injection.
The removed Spanish-catalog-pinning test is a test-only change. The author states it was removed. It does not add unrelated production behavior.
No unrelated production change is found in the summaries.
Full details: Description check
Explanation
The description gives a detailed explanation of the problem, implementation, scope, and linked issue. However, it omits most required template sections, including Visual Proof, Testing results, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist confirmations.
Resolution
Complete the required template sections. Add visual proof or state N/A with a reason, document manual and automated testing with platforms and results, complete applicable disclosure and review sections, confirm cross-platform and compatibility considerations, and check the applicable checklist items.
Finishing Touches
📝 Generate docstrings
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
15-18: Minor · Maintainability & Code Quality · Quick win
⚠️Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.
Keep diagnostic log text separate from translated dialog text.
When the selected locale is not English, reportProfileStateWriteFailure logs the translated options.message and options.detail at Line 36. This makes the saving-failure log text depend on the UI language. Log a stable English message or error code, and use the translated strings only in the dialog.
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 29777090-6a0b-42d5-98f3-4be0330db7fa
Commits
Reviewing files that changed from the base of the PR and between f4d98b7 and 434f760.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
Profile-state recovery, preflight failure and recovery-not-applied dialogs
can show before the settings store sets the main UI language. Resolve the
system language first so they no longer fall back to English.
Files skipped from review as they are similar to previous changes: 7
src/renderer/src/i18n/en-runtime-required.json
src/renderer/src/i18n/locales/en.json
src/renderer/src/i18n/locales/ko.json
src/renderer/src/i18n/locales/zh.json
src/renderer/src/i18n/locales/fr.json
src/renderer/src/i18n/locales/pt.json
src/renderer/src/i18n/locales/ja.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Supported by static analysis
Script executed:
set -e
printf'%s\n''--- src/main/index.ts ---'
nl -ba src/main/index.ts | sed -n '135,215p'printf'%s\n''--- src/main/i18n/main-i18n.ts ---'
nl -ba src/main/i18n/main-i18n.ts | sed -n '1,125p'printf'%s\n''--- src/main/startup/main-process-ready-foundation.ts ---'
nl -ba src/main/startup/main-process-ready-foundation.ts | sed -n '145,295p'printf'%s\n''--- src/main/startup/main-process-ready.ts ---'
nl -ba src/main/startup/main-process-ready.ts | sed -n '1,55p'printf'%s\n''--- src/main/startup/main-process-ready-runtime.ts ---'
nl -ba src/main/startup/main-process-ready-runtime.ts | sed -n '1,165p'printf'%s\n''--- plugin startup and language references ---'
rg -n -F --glob '*.ts' -e 'initializeMainProcessPlugins' -e 'pluginLanguagePacks' -e 'setMainUiLanguage' -e 'prepareEarlyMainUiLanguage' -e 'mainProcessI18nReady' src/main
printf'%s\n''--- relevant diff against supplied merge base ---'
git diff --unified=35 ec49e9fac0e18ab634a41f8e6071ab2183b9d46f 05ebc24795dc3f67bd29eff3e86e98cb8d85d49d -- src/main/index.ts src/main/i18n/main-i18n.ts src/main/startup/main-process-ready.ts src/main/startup/main-process-ready-foundation.ts src/main/startup/main-process-ready-runtime.ts src/main/startup/main-process-plugins.ts
Repository: stablyai/orca
Length of output: 41932
Script executed:
set -e
printf'%s\n''--- src/main/startup/main-process-plugins.ts ---'
nl -ba src/main/startup/main-process-plugins.ts | sed -n '1,175p'printf'%s\n''--- runtime initialization boundary ---'
nl -ba src/main/startup/main-process-ready-runtime.ts | sed -n '25,70p'
nl -ba src/main/startup/main-process-ready-runtime.ts | sed -n '120,150p'printf'%s\n''--- locale and language declarations ---'
rg -n -F --glob '*.ts' -e 'export function resolveUiLocale' -e 'export type UiLanguage' -e 'UI_LANGUAGE_SYSTEM' src/shared src/main/i18n
Repository: stablyai/orca
Length of output: 14228
Initialize the stored built-in locale before remaining startup work.
After state.store = store, add an awaited language initializer. It must load the stored built-in uiLanguage, leave plugin:* activation to the existing pack-registration path, and use the system/English fallback if loading fails.
This covers recovery dialogs after later foundation failures and runs before GPU listener installation. The recovered-launch and restart prompts can then use the stored built-in locale instead of English or the system locale.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Translate the recovery failure reason.
response.message remains English. For example, a lock failure tells the user to stop Orca before rollback in English, while the translated guidance only says to reopen Orca. A user who cannot read the reason may repeat the failed recovery. Localize known recovery errors for the desktop dialog while preserving the CLI response and interpolating paths or commands.
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
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.
Supersedes #27065 (by @outof-place; their commits are kept, plus a merge of main and maintainer edits).
What was wrong: native dialogs from the main process (GPU safe-mode prompts, profile-state recovery/copy-choice/repair, "Saving stopped", "Orca could not start", local build switch) were always in English.
What changed
translateMainwith stable keys. GPU dialog options are now built when the dialog opens, and the profile-state dialogs taketranslateas an injected dependency.translateMainalso fills{{placeholders}}before i18n init.chooseProfileStateRepair), including its section labels. CLI and log text that use the same labels stay in English.liveTerminals_one/liveTerminals_otherplural keys.main-i18n-pre-init.test.ts).prepareEarlyMainUiLanguage(), which uses the system language (same resolution as the "System" setting, viaapp.getPreferredSystemLanguages()). The persisted choice is not read there, because the store may be the thing that failed. Once a language has been set, it is kept, and normal startup still applies the user's setting. Before Electron is ready, the system language is read without being cached.profile-state-startup-failure.tsprose is still in English. It is mostly CLI commands and paths, and it is also logged.Closes #27064