Skip to content

fix(i18n): translate main-process startup failure and install-folder recovery text - #35832

Merged
OrcaWin merged 1 commit into
mainfrom
OrcaWin/i18n-main-codes-20
Oct 29, 2026
Merged

OrcaWin merged 1 commit into
mainfrom
OrcaWin/i18n-main-codes-20

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​37 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​37
Prod 16 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​562 $\color{#cf222e}{\Huge{\mathbf{−}}}$​63 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​499

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

  • 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.
  • profile-state-recovery-preflight.ts: the dialog was already translated in fix(i18n): translate the main-process startup and recovery dialogs #34608. response.message is 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: pass
  • pnpm tc: pass
  • 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
  • Codex review of the diff: no findings

@OrcaWin
OrcaWin requested a review from brennanb2025 as a code owner October 29, 2026 08:09
@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] This PR appears safe to merge.

Summary

This PR translates startup failure dialogs and Windows install-folder recovery text while keeping logs and recovery commands in English.

  • Profile-state startup dialogs now explain failures in the active language.
  • The Windows install-folder recovery prompt now explains its repair in the active language.

Reviews (1) · Last reviewed commit: "fix(i18n): translate main-process startu..." · Reviewed by Greptile

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Walkthrough

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: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning 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 Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: translating main-process startup-failure and install-folder recovery text.
Description check Passed 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 Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


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: f4d69f08-6975-4ea8-9553-3081bb586805
Commits

Reviewing files that changed from the base of the PR and between abbea99 and b16788f.

Files selected for processing: 17
  • src/main/index.ts
  • src/main/persistence/profile-state/profile-state-database-publication.ts
  • src/main/persistence/profile-state/profile-state-startup-failure.ts
  • src/main/startup/main-process-preflight-failure.ts
  • src/main/startup/profile-state-startup-failure-localization.test.ts
  • src/main/startup/windows-install-dir-acl-recovery.ts
  • src/renderer/src/i18n/locales/de.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/fr.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/pt.json
  • src/renderer/src/i18n/locales/ru.json
  • src/renderer/src/i18n/locales/tr.json
  • src/renderer/src/i18n/locales/zh-Hant.json
  • src/renderer/src/i18n/locales/zh.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

Comment on lines +265 to +268
const cause = translateMain(
'installDirAcl.cause',
"Windows permissions on Orca's install folder are blocking its own sandboxed processes from reading the files it shipped with."
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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 -u
printf '%s\n' '--- diff ---'
git diff --unified=40 57ff56f02a670cd530f81b8e8b66d1a943756c65 b16788fdc364ab7b4ca3ed00adadb14928029154 -- src/main/startup/windows-install-dir-acl-recovery.ts src/main/startup/main-process-ready.ts
printf '%s\n' '--- recovery references ---'
rg -n -F --glob '*.ts' -e 'describeInstallDirAclPoison' -e 'showRendererRecoveryPrompt' -e 'mainProcessI18nReady' -e 'translateMain' src/main src/shared || test "$?" -eq 1
printf '%s\n' '--- recovery source ---'
sed -n '1,360p' src/main/startup/windows-install-dir-acl-recovery.ts
printf '%s\n' '--- main-process-ready source ---'
sed -n '1,280p' src/main/startup/main-process-ready.ts

Repository: stablyai/orca

Length of output: 42051


Script executed:

set -u
git diff --unified=40 57ff56f02a670cd530f81b8e8b66d1a943756c65 b16788fdc364ab7b4ca3ed00adadb14928029154 -- src/main/startup/windows-install-dir-acl-recovery.ts src/main/startup/main-process-ready.ts
rg -n -F --glob '*.ts' -e 'describeInstallDirAclPoison' -e 'showRendererRecoveryPrompt' -e 'mainProcessI18nReady' -e 'translateMain' src/main src/shared || test "$?" -eq 1
sed -n '1,360p' src/main/startup/windows-install-dir-acl-recovery.ts
sed -n '1,280p' src/main/startup/main-process-ready.ts

Repository: stablyai/orca

Length of output: 42182


Script executed:

rg -n -C 8 -F --glob '*.ts' -e 'describeInstallDirAclPoison' -e 'showRendererRecoveryPrompt' -e 'mainProcessI18nReady' -e 'function translateMain' -e 'const translateMain' src/main src/shared

Repository: stablyai/orca

Length of output: 41666


Script executed:

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.

Suggested fix
 export async function showRendererRecoveryPrompt(
   recentRecoveryCount: number,
   failure?: RendererRecoveryPromptFailure,
   retry?: () => void,
   availableCommitMB?: number
 ): Promise<void> {
+  await state.mainProcessI18nReady
   await presentRendererRecoveryPrompt({

Add a delayed-catalog test for this path.

@OrcaWin
OrcaWin merged commit 48eca8c into main Oct 29, 2026
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant