Repository navigation
fix(i18n): localize browser link-routing description - #9654
seandoesdev wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between acb26b927172c6b38840280ab6adf4fd0bf13637 and bde3927. 📒 Files selected for processing (8)
🚧 Files skipped from review as they are similar to previous changes (8)
📝 WalkthroughWalkthroughAdded 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 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
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. Comment |
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.
acb26b9 to
bde3927
Compare
|
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. Two notes on your hash, since your PR body specifically called out reproducing it:
Your regression test shipped. The Closing in favour of #9444 — the test instinct here was the right one, and I'd like to see more from you. |
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 callstranslate('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).kois curated;ja/es/zhare 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
Before: description shown in English under Korean UI. After: description shown in Korean, with the platform shortcut label (
Shift+Ctrl+clickon Windows/Linux,⇧⌘-clickon macOS) preserved.Testing
pnpm typecheckpnpm test(scoped:browser-search.test.ts2/2,locale-ko-key-overrides+verify-localization-catalogtests 4/4)pnpm buildpnpm verify:localization-catalog(10,138 key references + es/ja/ko/zh parity verified)oxlintclean on the changed files (pre-commitlint-stagedoxlint + oxfmt passed)Note: the full
pnpm lintandpnpm verify:localization-coveragecurrently fail onmainfor reasons unrelated to this change (pre-existingswitch-exhaustivenesserrors inskill-freshness-group.tsx/daemon-server.ts, and unlocalized strings in theai-vaultsession files). None of those files are touched by this PR.AI Review Report
Reviewed with an AI coding agent. Main checks:
getBrowserLinkRoutingShortcutLabel()platform branch and passed as an interpolation value, so it stays literal and renders correctly per OS (⇧⌘-clickvsShift+Ctrl+click). No paths, shell behavior, keyboard-handling, or Electron main/renderer IPC were touched.{{shortcut}}) are consistent across all five locales, and locale parity passes. The interpolation param name matches the placeholder.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/zhvalues are included to satisfy catalog parity; maintainers may prefer to regenerate them through the existing machine-translation pipeline. Thekovalue is curated and pinned vialocale-ko-key-overrides.json.X: @your_handle