Skip to content

fix(i18n): translate the local host label and Orca restart notes - #43012

Merged
nwparker merged 1 commit into
stablyai:mainfrom
x-Ai:fix/i18n-host-label-restart-notes
Nov 16, 2026
Merged

nwparker merged 1 commit into
stablyai:mainfrom
x-Ai:fix/i18n-host-label-restart-notes

Conversation

@x-Ai

@x-Ai x-Ai commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • 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:

Before: Local Mac and restart notes in English

After:

After: 本地 Mac and translated restart notes

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".

  • vitest (config/vitest.config.ts): NativeChatNoticeRow.test.tsx, language-catalog-timeout.test.tsx pass.

  • verify:localization-catalogs, verify:localization-runtime-catalog, verify:mobile-localization pass.

  • 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)

@x-Ai
x-Ai marked this pull request as ready for review November 16, 2026 07:26
@x-Ai
x-Ai requested a review from brennanb2025 as a code owner November 16, 2026 07:26
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

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: Passed 4

Check name Status Explanation
Title check Passed 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 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.
Description check Passed 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.

Share

Recent 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: 8ba93ebd-5f52-41f6-ac97-4b4d40b499c6
Commits

Reviewing files that changed from the base of the PR and between f213197 and a3870d7.

Files selected for processing: 8

  • mobile/src/i18n/locales/zh.json
  • src/renderer/src/components/automations/listing/automation-list-host.ts
  • src/renderer/src/components/automations/use-automations-page-presentation-state.ts
  • src/renderer/src/components/native-chat/pane/ownership/use-structured-agent-session-host-label.ts
  • src/renderer/src/components/settings/repository/RepositoryRemoveProjectSection.tsx
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/runtime/hosts/display/execution-host-display-label.ts
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.

@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: 987f757e-de58-49d4-b19f-3b297665af43
Commits

Reviewing files that changed from the base of the PR and between 78c28ab and f213197.

Files selected for processing: 16

  • mobile/src/i18n/en-runtime-required.json
  • mobile/src/i18n/locales/en.json
  • mobile/src/i18n/locales/zh.json
  • mobile/src/session/native-chat/transcript/notices/MobileNativeChatNoticeRow.tsx
  • mobile/src/session/native-chat/transcript/notices/native-chat-restart-note-copy.ts
  • src/renderer/src/components/automations/details/AutomationDetail.tsx
  • src/renderer/src/components/automations/details/automation-source-display.ts
  • src/renderer/src/components/automations/hosts/automation-host-detail-display.ts
  • src/renderer/src/components/native-chat/messages/notices/NativeChatNoticeRow.tsx
  • src/renderer/src/components/native-chat/messages/notices/agent-session-restart-note-text.ts
  • src/renderer/src/components/native-chat/pane/ownership/use-structured-agent-session-host-label.ts
  • src/renderer/src/components/settings/repository/RepositoryRemoveProjectSection.tsx
  • src/renderer/src/i18n/en-runtime-required.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/runtime/hosts/display/execution-host-display-label.ts

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

): AutomationHostDetailDisplay {
const { automation, entry, hostLabelById } = input
if (entry) {
const label = translateExecutionHostLabel(entry.label, t)

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

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.

Also applies to: 39-42

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]>
@nwparker
nwparker force-pushed the fix/i18n-host-label-restart-notes branch from f213197 to a3870d7 Compare November 16, 2026 08:19
@nwparker
nwparker merged commit a5781b8 into stablyai:main Nov 16, 2026
45 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.

2 participants