Skip to content

fix(i18n): localize the remaining contextual tour steps - #12713

Open
5Hyeons wants to merge 4 commits into
stablyai:mainfrom
5Hyeons:fix/localize-remaining-contextual-tours
Open

5Hyeons wants to merge 4 commits into
stablyai:mainfrom
5Hyeons:fix/localize-remaining-contextual-tours

Conversation

@5Hyeons

@5Hyeons 5Hyeons commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Every contextual tour except Automations rendered its title and body in English even when the UI language was Korean, next to already-localized Next / Back / Done controls and progress label.

Root cause: #12270 localized the two Automation steps by whitelisting their step ids in a LOCALIZED_STEP_COPY map inside contextual-tour-overlay-measurement.ts. Every other step in src/shared/contextual-tours.ts has no id, so the lookup missed and the overlay fell back to the raw English step.title / step.body. Reported on the floating workspace tour, but workspace-board, agent-sessions, browser, tasks and workspace-creation were affected identically — 13 steps in total.

This PR:

  • gives every tour step a stable id and moves the copy lookup into contextual-tour-step-copy.ts, keyed by that id
  • routes the Split terminal primary-action label through the catalog too
  • adds the 31 new keys to en and translates them (plus the 5 keys fix(i18n): localize automation contextual tour #12270 left ko-only) for ko, es, ja, zh
  • adds a coverage test that walks CONTEXTUAL_TOURS and fails if any step resolves no localized copy, so a newly added step cannot ship untranslated

Screenshots

Floating workspace tour, UI language Korean. Before is the reported bug; after is captured from a real Electron run on this branch.

Before After
Step 1
Step 2

Testing

  • pnpm lint — fails only on verify:skill-bundle-manifest (resources/skills/*.json reported stale). Reproduced on a clean origin/main worktree, so it is pre-existing and unrelated to this change; every other gate in the chain passes, including verify:localization-catalog, verify:localization-extraction, verify:localization-coverage and check:max-lines-ratchet.
  • pnpm typecheck
  • pnpm test — 154 tests across 59 files fail on this Windows host, all in main-process / SSH / git / packaging suites (path-separator and spawnSync .cmd EINVAL failures). Checked out a clean origin/main in the same working copy and re-ran exactly those 59 files: identical 59 files / 154 tests fail. Pre-existing and unrelated to this change; nothing in the i18n, localization or contextual-tour suites fails.
  • pnpm build
  • Added or updated high-quality tests that would catch regressions, or explained why tests were not needed

Also run: pnpm exec vitest run --config config/vitest.config.ts src/renderer/src/components/contextual-tours/ src/shared/contextual-tours.test.ts (76 passed) and a real Electron capture of both Korean tour steps (the two "after" screenshots above; the throwaway capture spec is not part of the diff).

The new test is a coverage assertion rather than one case per step: it iterates CONTEXTUAL_TOURS, so the next tour step added without translations fails the suite instead of silently regressing one panel — the exact way this bug reached users.

AI Review Report

Reviewed with Claude Code. Risks checked:

  • Root cause vs. symptom — confirmed the failure is the missing step id, not the floating workspace tour specifically, and verified all 15 steps across 7 tours now resolve localized copy.
  • Key stability — the Automations keys are reused verbatim so already-shipped translations keep resolving; new keys are static string literals, which is what verify-localization-catalog and verify-localization-extraction require (template-literal keys are silently skipped by the extractor and would have orphaned the catalog entries).
  • Step insertion safety — copy stays keyed by step id, not index, so inserting a step cannot shift text onto a neighbour; the existing regression test for that still passes.
  • Cross-platform (macOS / Linux / Windows) — this is copy plus a lookup; no path, shell, or Electron-specific code. The one platform-sensitive detail is the {terminal.splitRight} marker in the split-pane step body: every translation keeps it verbatim, so formatContextualTourStepCopy still substitutes the platform-correct shortcut label (⌘ on Mac, Ctrl on Linux/Windows). Verified in the ko/es/ja/zh values. Screenshots were captured on Windows; the shortcut chips render Ctrl as expected.
  • SSH / folder workspaces — renderer-only presentation, identical on remote hosts and non-git folder workspaces.

Result: no findings required code changes beyond switching the initially-drafted template-literal keys to string literals.

Security Audit

No input handling, command execution, path handling, auth, secrets, dependency, or IPC surface is touched. The change adds static strings to the renderer localization catalog and a pure lookup function; translate() is called with constant keys and constant fallbacks, so no user- or agent-controlled data reaches interpolation. No new dependencies. No follow-up needed.

Notes

  • es / ja / zh also cover the 5 keys fix(i18n): localize automation contextual tour #12270 left English-only (Done plus the Automation step copy), so all five locales are now at parity for contextual tours.
  • I am a native Korean speaker, so I revised the Korean strings by hand after the first pass rather than shipping the literal translation: the floating workspace step 1 title is now "agent 하나로 모든 repo 다루기" (one agent covering every repo — the literal "모든 repo에서 agent 실행하기" repeated the body and lost the "across" sense), its body says "이곳의" instead of the stiffer "여기의", and step 2 uses the plain Korean "메모장처럼 사용하기" instead of transliterating "scratchpad". The screenshots above are re-captured with this wording. Other locales are literal-but-idiomatic and would benefit from a native review — happy to adjust anything a reviewer flags.
  • Translations follow each locale's existing conventions in the catalog (for example worktree stays English in es, agent and Terminal stay English in ja, 工作树 / 智能体 in zh).

🤖 Generated with Claude Code

The automations fix only routed its own two steps through translate(), so
every other tour still rendered raw English titles and bodies next to
already-localized Next/Back/Done controls. Give every step a stable id and
move the copy lookup into one module keyed by that id, so a new step is
localized by construction and a coverage test fails when it is not.
@5Hyeons
5Hyeons requested a review from brennanb2025 as a code owner August 5, 2026 11:42
@coderabbitai

coderabbitai Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Contextual tour steps now have stable identifiers for workspace, agent session, browser, task, floating workspace, and workspace creation tours. Shared localized copy provides English fallback text and localized primary-action labels. The overlay uses this lookup for titles, bodies, and actions. Locale resources include contextual-tour content in English, Korean, Spanish, Japanese, and Chinese. Tests verify Korean translations and English fallback behavior.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly and concisely describes the primary change: localizing the remaining contextual tour steps.
Description check ✅ Passed The description covers all required template sections, including user impact, screenshots, testing results, AI review, security audit, and notes.

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

🧹 Nitpick comments (1)
src/shared/contextual-tours.ts (1)

32-47: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider making id required now that every step has one.

All steps in CONTEXTUAL_TOURS, including the ones not touched by this PR, now set id. Keep id?: string optional, and a future step added without an id will compile without error. That step then has no stable anchor for localized copy, and it can silently fall back to the wrong copy or to English only.

Change the field to id: string (non-optional) so the type checker catches a missing id on any new step at the source, instead of relying on the copy-lookup layer or tests to catch it downstream.

♻️ Proposed change
 export type ContextualTourStep = {
   // Stable anchor for localized copy — position-keyed translations shift onto the wrong step when one is inserted.
-  id?: string
+  id: string
   title: string

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9a408867-6c00-4ebe-b603-4b680b5d7b57

📥 Commits

Reviewing files that changed from the base of the PR and between eea0bb6 and 60ba6c2.

📒 Files selected for processing (7)
  • config/scripts/locale-ko-key-overrides.json
  • src/renderer/src/components/contextual-tours/contextual-tour-overlay-measurement.ts
  • src/renderer/src/components/contextual-tours/contextual-tour-step-copy.test.ts
  • src/renderer/src/components/contextual-tours/contextual-tour-step-copy.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/ko.json
  • src/shared/contextual-tours.ts

The tour catalog ships five locales; ko alone left Spanish, Japanese, and
Chinese users on the English fallback for the same steps.

@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: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 53185d10-ad30-4499-85ee-7b70064aa1a5

📥 Commits

Reviewing files that changed from the base of the PR and between 60ba6c2 and dcd396b.

📒 Files selected for processing (3)
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/zh.json

Comment thread src/renderer/src/i18n/locales/es.json Outdated
Comment thread src/renderer/src/i18n/locales/es.json Outdated
5Hyeons added 2 commits August 5, 2026 22:02
Addresses CodeRabbit review: a required `id` makes a new step without a stable
copy anchor a type error rather than a silent English fallback, the coverage
test now fails on a missing action label instead of an undefined one, and the
Spanish Next label and name-step title use idiomatic wording.
Native-reader feedback: "이곳의" reads better than "여기의", the title now says
what the step actually offers (one agent covering every repo), and the
scratchpad step uses a plain Korean word instead of a transliteration.

This branch has not been deployed

No deployments
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.

4 participants