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 main-process startup failure and install-folder recovery text - #35832
Main-process startup failure dialogs and the Windows install-folder recovery detail now read their text through translateMain(), so they follow the UI language (or the system language before settings load) instead of always showing English.
What Changed
formatProfileStateStartupFailure takes an optional translator (English by default, so logs keep English). Both dialog callers pass translateMain: src/main/index.ts (startup recovery dialog) and main-process-preflight-failure.ts. The damaged-section names now go through the same translator.
Converted: unreadable SQLite state, ambiguous profile-state authority, newer schema, revision conflict, writer unavailable, the hard-link publication failure, and the damaged-sections repair text. Paths and orca profile state … commands are {{placeholders}}, so they stay verbatim.
Preflight failure: the message is now built inside the dialog callback. On Linux the dialog waits for app.whenReady() + prepareEarlyMainUiLanguage() (added in fix(i18n): translate the main-process startup and recovery dialogs #34608), so it uses the system-language catalog. macOS/Windows show the dialog synchronously before ready, so they stay English as before.
index.ts: the dialog fallback "Orca could not finish starting: {{detail}}" is translated. The console log stays English.
ProfileStateDatabasePublicationError keeps its English message (built by the same function) and now exposes directory, so the dialog can translate it. An error that doesn't carry directory still shows its message.
describeInstallDirAclPoison (detail of the blank-window recovery prompt) uses translateMain. The admin commands are still appended verbatim.
30 new keys under profileState.startupFailure.*, startupFailure.finishFailed and installDirAcl.*, translated in all 10 locales. They are literal keys under src/main, so main-locale-subset ships them in the main bundle.
Left as is:
windows-app-data-path.ts: this error only appears in the Windows pre-ready preflight dialog. That dialog has to stay synchronous and no catalog has loaded yet, so translating it would change nothing.
desktop-push-service.ts "Test notification": orcad (no Electron, no main i18n) also sends it, and it is shown on the phone. Other push titles are not localized either.
Why
Native dialogs built by main never went through i18n, so these failure dialogs were English in every UI language.
pnpm test on the new src/main/startup/profile-state-startup-failure-localization.test.ts (Spanish catalog text, commands kept verbatim, English without a translator), profile-state-startup-failure.test.ts, windows-install-dir-acl-recovery.test.ts, renderer-recovery-prompt.test.ts, browser-process-user-agent-ordering.test.ts, src/main/i18n: pass
Profile-state startup failure formatting now accepts a translator and uses shared publication guidance that includes the database directory. Startup and preflight failure dialogs format error details through localized messages. Tests check Spanish catalog text and English fallback text. Locale catalogs add profile recovery, startup completion, and Windows installation-directory ACL messages. The ACL recovery description translates its cause, status, and administrator-command instructions.
Priority: Normal
Merge Risk: Minimal · up to b1678
Some early recovery prompts may still appear in English. No merge-blocking regression was identified.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: translating main-process startup-failure and install-folder recovery text.
Description check
The description gives a clear user-facing summary, detailed changes, rationale, testing results, and visual-proof status. It is mostly complete, but it uses “Refs #32207” instead of the template’s req…
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: Description check
Explanation
The description gives a clear user-facing summary, detailed changes, rationale, testing results, and visual-proof status. It is mostly complete, but it uses “Refs #32207” instead of the template’s required issue link format and omits several template headings, including ELI5, Review, Notes, and Checklist.
Full details: Docstring Coverage
Explanation
Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 4 functions across 6 files. (11 skipped: 11 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches: 💡 1
📝 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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
set -u
printf'%s\n''--- recovery prompt implementation ---'
sed -n '1,280p' src/main/window/renderer-recovery-prompt.ts
printf'%s\n''--- main i18n implementation ---'
sed -n '1,220p' src/main/i18n/main-i18n.ts
printf'%s\n''--- main i18n menu initialization ---'
sed -n '1,220p' src/main/startup/main-process-i18n-menu.ts
printf'%s\n''--- early language preparation references ---'
rg -n -C 12 -F --glob '*.ts' -e 'prepareEarlyMainUiLanguage' -e 'setMainUiLanguage' -e 'initializeMainProcessI18nAndMenu' src/main src/shared ||test"$?" -eq 1
Repository: stablyai/orca
Length of output: 42326
Script executed:
sed -n '1,280p' src/main/window/renderer-recovery-prompt.ts
sed -n '1,220p' src/main/i18n/main-i18n.ts
sed -n '1,220p' src/main/startup/main-process-i18n-menu.ts
rg -n -C 12 -F --glob '*.ts' -e 'prepareEarlyMainUiLanguage' -e 'setMainUiLanguage' -e 'initializeMainProcessI18nAndMenu' src/main src/shared ||test"$?" -eq 1
Repository: stablyai/orca
Length of output: 42325
Wait for main-process i18n before presenting the renderer recovery prompt.
presentRendererRecoveryPrompt() calls describeInstallDirAclPoison() while building the dialog. showRendererRecoveryPrompt() does not await state.mainProcessI18nReady, so an early recovery prompt can use English fallback text while the selected locale catalog is still loading.
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.
Summary
Main-process startup failure dialogs and the Windows install-folder recovery detail now read their text through
translateMain(), so they follow the UI language (or the system language before settings load) instead of always showing English.What Changed
formatProfileStateStartupFailuretakes an optional translator (English by default, so logs keep English). Both dialog callers passtranslateMain:src/main/index.ts(startup recovery dialog) andmain-process-preflight-failure.ts. The damaged-section names now go through the same translator.orca profile state …commands are{{placeholders}}, so they stay verbatim.app.whenReady()+prepareEarlyMainUiLanguage()(added in fix(i18n): translate the main-process startup and recovery dialogs #34608), so it uses the system-language catalog. macOS/Windows show the dialog synchronously before ready, so they stay English as before.index.ts: the dialog fallback "Orca could not finish starting: {{detail}}" is translated. The console log stays English.ProfileStateDatabasePublicationErrorkeeps its English message (built by the same function) and now exposesdirectory, so the dialog can translate it. An error that doesn't carrydirectorystill shows itsmessage.describeInstallDirAclPoison(detail of the blank-window recovery prompt) usestranslateMain. The admin commands are still appended verbatim.profileState.startupFailure.*,startupFailure.finishFailedandinstallDirAcl.*, translated in all 10 locales. They are literal keys undersrc/main, somain-locale-subsetships them in the main bundle.Left as is:
windows-app-data-path.ts: this error only appears in the Windows pre-ready preflight dialog. That dialog has to stay synchronous and no catalog has loaded yet, so translating it would change nothing.profile-state-recovery-preflight.ts: the dialog was already translated in fix(i18n): translate the main-process startup and recovery dialogs #34608.response.messageis the recovery command's diagnostic text, shared with the CLI JSON result.desktop-push-service.ts"Test notification": orcad (no Electron, no main i18n) also sends it, and it is shown on the phone. Other push titles are not localized either.Why
Native dialogs built by main never went through i18n, so these failure dialogs were English in every UI language.
Linked Issue
Refs #32207
Visual Proof
N/A — copy/i18n only.
Testing
pnpm sync:localization-runtime-catalog,pnpm verify:localization-catalogs,verify:localization-catalog,verify:localization-extraction,verify:localization-coverage,verify:localization-runtime-catalog: passpnpm tc: passpnpm teston the newsrc/main/startup/profile-state-startup-failure-localization.test.ts(Spanish catalog text, commands kept verbatim, English without a translator),profile-state-startup-failure.test.ts,windows-install-dir-acl-recovery.test.ts,renderer-recovery-prompt.test.ts,browser-process-user-agent-ordering.test.ts,src/main/i18n: pass