Skip to content

fix(i18n): localize browser link-routing description - #9654

Closed
seandoesdev wants to merge 1 commit into
stablyai:mainfrom
seandoesdev-lab:feat/localize-link-routing-description
Closed

seandoesdev wants to merge 1 commit into
stablyai:mainfrom
seandoesdev-lab:feat/localize-link-routing-description

Conversation

@seandoesdev

Copy link
Copy Markdown

Summary

The Link Routing setting description (Settings → Workflow → Browser) was a hardcoded English template literal, so it bypassed the i18n catalog and stayed in English even when the UI language was set to a non-English locale — while its own title and every neighboring setting were already translated.

This routes the description through translate() with a {{shortcut}} interpolation (the platform keybinding stays a literal, uninterpolated value) and registers the string in every locale catalog.

Closes #9652

What changed

  • src/renderer/src/components/settings/browser-search.ts — getBrowserLinkRoutingDescription() now calls translate('auto.components.settings.browser.search.00f82a4c3d', <fallback>, { shortcut }) instead of returning a hardcoded template literal.
  • src/renderer/src/i18n/locales/{en,ko,ja,es,zh}.json — added the new key. The key hash matches the repo's existing convention (sha1(<relative file path>:<source string>), first 10 chars). ko is curated; ja/es/zh are included for catalog parity.
  • config/scripts/locale-ko-key-overrides.json — added the curated Korean value so catalog regeneration (machine translation) preserves it.
  • src/renderer/src/components/settings/browser-search.test.ts — added a regression guard asserting the shortcut is interpolated (no raw {{shortcut}} leaks).

Screenshots

⚠️ TODO (author): attach before/after screenshots of the Korean Settings → Workflow → Browser → Link Routing pane.

Before: description shown in English under Korean UI. After: description shown in Korean, with the platform shortcut label (Shift+Ctrl+click on Windows/Linux, ⇧⌘-click on macOS) preserved.

Testing

  • pnpm typecheck
  • pnpm test (scoped: browser-search.test.ts 2/2, locale-ko-key-overrides + verify-localization-catalog tests 4/4)
  • pnpm build
  • pnpm verify:localization-catalog (10,138 key references + es/ja/ko/zh parity verified)
  • oxlint clean on the changed files (pre-commit lint-staged oxlint + oxfmt passed)
  • Added a regression test for the interpolation behavior

Note: the full pnpm lint and pnpm verify:localization-coverage currently fail on main for reasons unrelated to this change (pre-existing switch-exhaustiveness errors in skill-freshness-group.tsx / daemon-server.ts, and unlocalized strings in the ai-vault session files). None of those files are touched by this PR.

AI Review Report

Reviewed with an AI coding agent. Main checks:

  • Cross-platform (macOS/Linux/Windows): the shortcut label is produced by the existing getBrowserLinkRoutingShortcutLabel() platform branch and passed as an interpolation value, so it stays literal and renders correctly per OS (⇧⌘-click vs Shift+Ctrl+click). No paths, shell behavior, keyboard-handling, or Electron main/renderer IPC were touched.
  • i18n correctness: the new key follows the repo's hash convention (verified by reproducing an existing key's hash), placeholders ({{shortcut}}) are consistent across all five locales, and locale parity passes. The interpolation param name matches the placeholder.
  • SSH/remote & providers: no runtime, process, git-provider, or network behavior involved — pure renderer copy.
  • Behavior: no functional change beyond localizing an existing string; the fallback preserves the original English wording verbatim.

Security Audit

No security-relevant surface. The change adds static i18n catalog data and one translate() call. No user input handling, command execution, path handling, authentication, secrets, dependencies, or IPC were added or modified.

Notes

  • ja/es/zh values are included to satisfy catalog parity; maintainers may prefer to regenerate them through the existing machine-translation pipeline. The ko value is curated and pinned via locale-ko-key-overrides.json.
  • No changes to release/version files.

X: @your_handle

@coderabbitai

coderabbitai Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 0ca2aec3-0810-4a47-84fb-9e6da13e5ada

📥 Commits

Reviewing files that changed from the base of the PR and between acb26b927172c6b38840280ab6adf4fd0bf13637 and bde3927.

📒 Files selected for processing (8)
  • config/scripts/locale-ko-key-overrides.json
  • src/renderer/src/components/settings/browser-search.test.ts
  • src/renderer/src/components/settings/browser-search.ts
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/ko.json
  • src/renderer/src/i18n/locales/zh.json
🚧 Files skipped from review as they are similar to previous changes (8)
  • src/renderer/src/components/settings/browser-search.test.ts
  • config/scripts/locale-ko-key-overrides.json
  • src/renderer/src/i18n/locales/es.json
  • src/renderer/src/components/settings/browser-search.ts
  • src/renderer/src/i18n/locales/ja.json
  • src/renderer/src/i18n/locales/en.json
  • src/renderer/src/i18n/locales/zh.json
  • src/renderer/src/i18n/locales/ko.json

📝 Walkthrough

Walkthrough

Added localized browser link routing descriptions for English, Spanish, Japanese, Korean, and Chinese. Updated the settings logic to translate the description and interpolate platform-specific shortcut labels. Added macOS and non-macOS assertions ensuring the {{shortcut}} placeholder is replaced. Added the corresponding Korean locale key override.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning Mostly complete, but the Screenshots section is still a TODO instead of including screenshots or marking no visual change. Attach before/after screenshots or a screen recording, or state 'No visual change' if that is accurate.
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 (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: localizing the browser link-routing description.
Linked Issues check ✅ Passed The PR routes the Link Routing description through i18n, adds locale entries, and preserves shortcut interpolation, addressing #9652.
Out of Scope Changes check ✅ Passed All changes support the localization fix: renderer copy, locale catalogs, Korean override, and a regression test; no unrelated scope is evident.

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.

The Link Routing setting description was a hardcoded English template literal, so it bypassed the i18n catalog and stayed English in every non-English UI. Route it through translate() with a {{shortcut}} interpolation (the platform keybinding stays literal) and add the key to all locale catalogs (ko curated, ja/es/zh included) plus the ko key-override so regeneration preserves it.
@seandoesdev
seandoesdev force-pushed the feat/localize-link-routing-description branch from acb26b9 to bde3927 Compare July 21, 2026 02:43
@AmethystLiang
AmethystLiang requested a review from OrcaWin July 22, 2026 17:04
@nwparker

Copy link
Copy Markdown
Contributor

Thank you for this, @seandoesdev — and welcome. Your write-up was the most thorough of the three PRs that landed on this bug, and one piece of it shipped.

We're consolidating this cluster on #9444, primarily on the placeholder name. {{shortcut}} reads better than {{value0}} — I'd agree with you on pure legibility — but the auto.* namespace is machine-generated by localize-renderer-strings.mjs, which names interpolations positionally (value${index}). The catalog bears that out: across ~10.9k auto keys the placeholders are value0 (769), value1 (141), value2 (30) and so on, and the handful of named ones sit in hand-authored keys. A named placeholder in an auto.* key would be reverted the next time the codemod regenerated the entry, taking the four translations with it.

Two notes on your hash, since your PR body specifically called out reproducing it:

  • The formula you documented — sha1(<relative file path>:<source string>), first 10 chars — is correct. The subtlety is which string. For a template literal the candidate is only the whitespace-compacted head (uniqueCandidates() dedupes by start:end:kind, so only the head survives; compactText() then trims it), not the assembled string with the placeholder spliced in. So the generated key is 904ce58440 regardless of what you name the placeholder — 00f82a4c3d is the hash of the full {{shortcut}} form.
  • Because the hash doesn't depend on the placeholder name, the ko override wasn't needed here either. locale-ko-key-overrides.json pins curated Korean against the machine-translation pass; only ~27% of the keys in this namespace carry one, and the reviewed-in-context translation in the catalog stands on its own.

Your regression test shipped. The expect(description).not.toContain('{{shortcut}}') assertion was the genuinely valuable idea in this cluster — none of the other PRs guarded against a leaked placeholder, which is the exact failure mode if the interpolation name ever drifts from the catalog. It's in #9444 generalized to not.toMatch(/\{\{.+?\}\}/) so it catches any placeholder rather than one specific name, in both platform branches. That prompted a broader locale-switching test as well. Credited in the PR.

Closing in favour of #9444 — the test instinct here was the right one, and I'd like to see more from you.

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.

[Bug]: "Link Routing" setting description stays in English under Korean UI

3 participants