Repository navigation
fix(i18n): localize sidebar copy and correct Japanese mistranslations - #28921
Conversation
|
No actionable comments were generated in the recent review.
|
Route hardcoded sidebar strings (cache timer, delete-worktree dialog, imported-worktrees line, remote file browser, setup-script prompt, card agents/ports/status, add-repo busy labels, batch action menus) through i18n keys, and fix literal-sense Japanese translations in ja.json. Co-authored-by: Neil <[email protected]>
8bd24aa to
9213403
Compare
ELI5
Some text in the left sidebar was typed in English straight into the code, so it stayed English even when you picked another UI language. This sends that text through the normal translation step, adds the Japanese strings, and fixes a batch of existing Japanese strings that had picked the wrong meaning of the English word (for example "Sleeping" had become "asleep in bed").
What Changed
Before: with the UI set to Japanese, the sidebar still showed English such as "Hiding 4 discovered worktrees", "Keep 4 discovered worktrees hidden…" (aria label), "Delete Workspace", "Mark as read", "Loading issue...", the cache timer, remote file browser, setup-script prompt, and add-project busy labels.
After: those strings come from i18n keys. English copy is the same except the batch delete button, which now says "Delete 1 Workspace" for a single item instead of "Delete 1 Workspaces".
Mechanism:
translate()with keys inen.json/en-runtime-required.jsonand Japanese inja.json. Other locales fall back to English until the next catalog translation run._one/_otherkeys picked withcount === 1, matching existing sidebar patterns. Sentences are translated whole. The old{{value0}} hidden worktrees for {{value1}}aria label, which put English "Expand"/"Collapse" intovalue0, becomes two keys, and the old key is removed from all locales.workspace-batch-action-labels.ts. The duplicated add-project busy labels move intoadd-repo-busy-labels.ts.imported-worktrees-card-actions.tserror constants become functions, so the message is resolved in the current language when the error is set.ja.json: 25 literal-sense mistranslations fixed, values only, using terms the catalog already uses. Examples: "Hosted on {{device}}" was "an event is held at {{device}}", "Sleep with Descendants" was "go to bed with your descendants", "Grace" was the name "Grace", "within this window" (time window) was translated as a UI window. The full before/after table is in fix(i18n): localize sidebar copy and correct Japanese mistranslations #28921.Out of scope:
delete-worktree-dialog-copy.tsandworktree-card-agent-summary.tsstill build sentences from pieces and need a separate restructuring.NON_GIT_REPO_ERRORis matched against main-process error text, so it is not display copy.Why
The sidebar is the most-viewed surface in Orca, so mixed English and Japanese there stands out. Wrapping each string in place follows the pattern the rest of the sidebar already uses, so no new mechanism is needed. Moving the shared label builders into single modules keeps the two menus from drifting apart.
Linked Issue
Fixes #28920
Visual Proof
UI language: Japanese. The project has hidden discovered worktrees. The aria labels are printed under the sidebar.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Rendered the hidden-worktrees sidebar line with UI language set to Japanese on
mainand on this branch (headless, macOS). The screenshots above show the result.pnpm test src/renderer/src/components/sidebar/imported-worktrees-card-actions.test.ts src/renderer/src/i18n: 14 files, 117 tests pass. That run includes the runtime-required catalog and localized-catalog checks. The card-actions test is updated for the new error getters.CI static gates on the touched files are clean: anti-slop oxlint, code-quality native plugins, ast-grep,
check-changed-code-quality.mjs, andoxfmt --check.Tested on macOS. The change touches renderer copy only, with no platform, path, IPC, or remote-protocol changes, so Linux, Windows, SSH, and mixed-version remotes are unaffected.
Original fix by @kojikojikojikoji in #28921. Follow-up maintainer commits are squashed in: shared batch-action labels, card titles kept free of placeholders, and an unreachable key removed.
Notes
Copy-only change plus small label-module consolidation. No new IPC, no state changes, nothing in hot paths. Desktop renderer sidebar only; no mobile surface is touched.