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 local host label and Orca restart notes - #43012
With Orca set to a language other than English (for example Chinese), a few chat messages still showed in English: the name of your own computer ("Local Mac") inside the "Orca restarted for an update" notice, and the short notes Orca adds to a chat after it continues an agent following a restart. They now show in your chosen language on desktop and mobile. Machine names you typed yourself stay exactly as you typed them.
What Changed
Before: in a Chinese UI, the stop notice read "此回复进行期间,Local Mac 上的 Orca 为更新而重新启动…" and the four restart notes ("Orca asked this agent to continue after a restart. Your own prompt was not re-sent.", etc.) were English. After: the notice reads "本地 Mac 上的 Orca…" and all four restart notes are translated.
Mechanism:
selectExecutionHostDisplayLabel falls back to the existing getTranslatedExecutionHostLabel(hostId, t) instead of the English getExecutionHostLabel, and takes an optional t. A user rename override returns before this, so renames are never translated. useStructuredAgentSessionHostLabel and the remove-project settings pass the reactive t, so the label follows a language switch. Other display-only readers of the selector (hidden projects, machine badge, sleep dialog, AI Vault delete, group hook settings, host-unreachable toast) get the translated default too.
Automations: the default 'local' entry of hostLabelById and the unscoped-row fallback in automationRowHostLabel now use the translated local label, before rename overrides are applied, so list rows, detail and the source line agree.
The host (main or a paired orcad) journals the four restart continuation notes (continued, refused, unconfirmed, not connected) as fixed English constants. Desktop NativeChatNoticeRow (agent-session-restart-note-text.ts) and mobile MobileNativeChatNoticeRow (native-chat-restart-note-copy.ts) map that exact text to catalog keys at display time, the same pattern agentSessionGoalControlWords already uses. Anything else is shown unchanged. Journal and wire format are unchanged.
New English keys (components.native-chat.notices.restart*, mobile chat.restartNote.*), regenerated runtime-required English catalogs, and Simplified Chinese for the new keys.
Why
The notes are written outside the renderer and stored in the journal, so translating at display time also covers chats saved earlier and notes from older servers, with no protocol change. Translating the local label inside the shared selector fixes every reader at once instead of patching call sites, and doing it before overrides keeps the "renamed hosts show as typed" rule.
Linked Issue
Part of #32207 (that issue tracks other untranslated copy as well, so this PR does not close it).
Visual Proof
Simplified Chinese UI, NativeChatNoticeRow rendered through a component fixture (Orca stop notice for a local chat, then the four restart notes).
Before:
After:
Testing
Reproduced on origin/main with probe tests under the zh locale: the rendered restart notes were English and selectExecutionHostDisplayLabel(state, 'local') returned "Local Linux". On this branch the notes render in Chinese, the label is 本地 Linux, the hook follows an en to zh language switch, and a host renamed "Local Mac" still returns "Local Mac".
CI static gates on the touched files (anti-slop oxlint, code-quality oxlint, ast-grep, changed-code quality) and oxfmt --check are clean.
Platform: macOS (component fixture and unit tests). Not reproduced end to end with a real restart interrupting a reply; no manual Windows, Linux, SSH or phone testing. The local label path is platform-keyed through the existing helper.
No new tests kept: the repo's test anti-patterns exclude copy/translation assertions.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Risk
Level: Low. Only displayed text changes. If a restart note constant in agent-session-restart-continuation.ts is reworded later, the exact match misses and that note shows in English, as it does today. Renamed hosts are never translated. Older paired servers write the same constants, so their notes get translated; older clients are unaffected. A plain revert backs it out.
Review
All callers of selectExecutionHostDisplayLabel use the result for display only; the two raw-ID comparisons apply only to SSH and runtime hosts, which this does not touch. The notice row's failure, Orca-stop and usage-limit branches still take precedence over the restart-note lookup, and user prompts never reach it.
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Local, SSH and paired-server chats share this display path, and mobile reads the same shared English constants. No native code, settings or stored data change.
Original fix by @x-Ai; maintainer follow-ups (automation host labels, reusing getTranslatedExecutionHostLabel) are squashed into one commit with their authorship preserved.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
No actionable comments were generated in the recent review.
Walkthrough
Added localized restart-continuation notices for mobile and renderer chat surfaces. The notice rows translate recognized restart messages and preserve their existing fallback behavior for other text. Updated renderer execution-host label selection to accept an optional translator, and updated its consumers and automation host-label displays to use translated local labels.
Merge Risk: Minimal · up to a3870
This change translates the local host label and the restart notes in desktop and mobile chat. Unrenamed local labels now display in the user's language, and user-renamed labels and the stored journal text are unchanged. I found no remaining merge-blocking risk.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the two main changes: translating the local host label and the Orca restart notes. Both match the diff, which adds translation of the unrenamed local host label through the selector an…
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.
Description check
The description follows the template well. It has a plain-language ELI5, a before/after for the user, and a mechanism section. It also covers the why, the linked issue (partial, with "Part of #32207" …
Full details: Title check
Explanation
The title names the two main changes: translating the local host label and the Orca restart notes. Both match the diff, which adds translation of the unrenamed local host label through the selector and maps four restart-note strings to catalog keys. The title is specific, short, and uses the conventional fix(i18n) prefix. It does not cover the automation and toast call sites, which is expected.
Full details: Description check
Explanation
The description follows the template well. It has a plain-language ELI5, a before/after for the user, and a mechanism section. It also covers the why, the linked issue (partial, with "Part of #32207" instead of "Fixes #"), visual proof with before/after images, testing steps on macOS, and a risk level with backout. It has an AI disclosure section that is left blank, and the Review, Agent skill boundary, and Notes sections are filled in. Remaining gaps: the AI Disclosure section is empty, and the final lint/typecheck/test/build checklist item is unchecked. The linked issue is not a closing link, but the author explains why. These are non-critical gaps, so the description is mostly complete.
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.
Files skipped from review as they are similar to previous changes: 3
mobile/src/i18n/locales/zh.json
src/renderer/src/i18n/locales/en.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; 6 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Translate only generated local-host labels.
For an SSH target ID of "Local Mac", the fallback returns "Local Mac" from getExecutionHostLabel. This code then translates the remote target ID as local-host UI text. Catalog labels and map-provided names have the same problem when they match a translation sentinel.
Preserve explicit names and remote IDs. Translate only a generated default local-host label. Apply the same distinction in getAutomationSourceDisplay, which also translates the resolved string without checking its origin.
The unrenamed local host label ("Local Mac") and the four restart
continuation notes the host journals in English stayed English in every
UI language.
selectExecutionHostDisplayLabel and the automation host labels now
resolve the local host through the translated label, and desktop and
mobile notice rows map the exact English restart-note text to catalog
keys at display time, so saved chats and older servers read translated
too. Renamed hosts still show as typed.
Co-authored-by: Neil <[email protected]>
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.
ELI5
With Orca set to a language other than English (for example Chinese), a few chat messages still showed in English: the name of your own computer ("Local Mac") inside the "Orca restarted for an update" notice, and the short notes Orca adds to a chat after it continues an agent following a restart. They now show in your chosen language on desktop and mobile. Machine names you typed yourself stay exactly as you typed them.
What Changed
Before: in a Chinese UI, the stop notice read "此回复进行期间,Local Mac 上的 Orca 为更新而重新启动…" and the four restart notes ("Orca asked this agent to continue after a restart. Your own prompt was not re-sent.", etc.) were English.
After: the notice reads "本地 Mac 上的 Orca…" and all four restart notes are translated.
Mechanism:
selectExecutionHostDisplayLabelfalls back to the existinggetTranslatedExecutionHostLabel(hostId, t)instead of the EnglishgetExecutionHostLabel, and takes an optionalt. A user rename override returns before this, so renames are never translated.useStructuredAgentSessionHostLabeland the remove-project settings pass the reactivet, so the label follows a language switch. Other display-only readers of the selector (hidden projects, machine badge, sleep dialog, AI Vault delete, group hook settings, host-unreachable toast) get the translated default too.'local'entry ofhostLabelByIdand the unscoped-row fallback inautomationRowHostLabelnow use the translated local label, before rename overrides are applied, so list rows, detail and the source line agree.orcad) journals the four restart continuation notes (continued, refused, unconfirmed, not connected) as fixed English constants. DesktopNativeChatNoticeRow(agent-session-restart-note-text.ts) and mobileMobileNativeChatNoticeRow(native-chat-restart-note-copy.ts) map that exact text to catalog keys at display time, the same patternagentSessionGoalControlWordsalready uses. Anything else is shown unchanged. Journal and wire format are unchanged.components.native-chat.notices.restart*, mobilechat.restartNote.*), regenerated runtime-required English catalogs, and Simplified Chinese for the new keys.Why
The notes are written outside the renderer and stored in the journal, so translating at display time also covers chats saved earlier and notes from older servers, with no protocol change. Translating the local label inside the shared selector fixes every reader at once instead of patching call sites, and doing it before overrides keeps the "renamed hosts show as typed" rule.
Linked Issue
Part of #32207 (that issue tracks other untranslated copy as well, so this PR does not close it).
Visual Proof
Simplified Chinese UI,
NativeChatNoticeRowrendered through a component fixture (Orca stop notice for a local chat, then the four restart notes).Before:
After:
Testing
Reproduced on
origin/mainwith probe tests under thezhlocale: the rendered restart notes were English andselectExecutionHostDisplayLabel(state, 'local')returned "Local Linux". On this branch the notes render in Chinese, the label is 本地 Linux, the hook follows an en to zh language switch, and a host renamed "Local Mac" still returns "Local Mac".vitest(config/vitest.config.ts):NativeChatNoticeRow.test.tsx,language-catalog-timeout.test.tsxpass.verify:localization-catalogs,verify:localization-runtime-catalog,verify:mobile-localizationpass.CI static gates on the touched files (anti-slop oxlint, code-quality oxlint, ast-grep, changed-code quality) and
oxfmt --checkare clean.Platform: macOS (component fixture and unit tests). Not reproduced end to end with a real restart interrupting a reply; no manual Windows, Linux, SSH or phone testing. The local label path is platform-keyed through the existing helper.
No new tests kept: the repo's test anti-patterns exclude copy/translation assertions.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Risk
Level: Low. Only displayed text changes. If a restart note constant in
agent-session-restart-continuation.tsis reworded later, the exact match misses and that note shows in English, as it does today. Renamed hosts are never translated. Older paired servers write the same constants, so their notes get translated; older clients are unaffected. A plain revert backs it out.Review
All callers of
selectExecutionHostDisplayLabeluse the result for display only; the two raw-ID comparisons apply only to SSH and runtime hosts, which this does not touch. The notice row's failure, Orca-stop and usage-limit branches still take precedence over the restart-note lookup, and user prompts never reach it.Agent skill upstream boundary
Notes
Local, SSH and paired-server chats share this display path, and mobile reads the same shared English constants. No native code, settings or stored data change.
Original fix by @x-Ai; maintainer follow-ups (automation host labels, reusing
getTranslatedExecutionHostLabel) are squashed into one commit with their authorship preserved.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)