Repository navigation
fix(i18n): localize Commit & Sync, Rebase, and Create PR hints in the source control dropdown - #14127
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthrough
Priority: Merge Risk:
|
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
… source control dropdown The Commit & Sync tooltip, the Rebase label/tooltip, and the Create PR blocked hints were bare English literals while the labels beside them went through translate(). Route all 25 strings through translate() with named placeholders and add the keys to the English catalog. Co-authored-by: Neil <[email protected]>
02c99eb to
f615ed2
Compare
There was a problem hiding this comment.
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:
ed29070b-9dd9-4b6a-998b-a7e128f5d8da
Files selected for processing: 5-
src/renderer/src/components/right-sidebar/source-control-dropdown-commit-items.tssrc/renderer/src/components/right-sidebar/source-control-dropdown-items.test.tssrc/renderer/src/components/right-sidebar/source-control-dropdown-remote-items.tssrc/renderer/src/components/right-sidebar/source-control-dropdown-review-items.tssrc/renderer/src/i18n/locales/en.json
Files skipped from review as they are similar to previous changes: 4-
- src/renderer/src/components/right-sidebar/source-control-dropdown-review-items.ts
- src/renderer/src/components/right-sidebar/source-control-dropdown-remote-items.ts
- src/renderer/src/components/right-sidebar/source-control-dropdown-commit-items.ts
- src/renderer/src/i18n/locales/en.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
-
ELI5
The source control dropdown has tooltips that explain what an item does or why it is disabled (for example "Commit changes first" or "Publish the branch first to sync commits"). Those explanations were hard-coded in English, so even with Orca set to another language they stayed English next to translated menu labels. This change makes them translatable like the rest of the menu.
What Changed
HostedReviewCreationBlockedReasonplus loading / not-ready fallbacks) were returned as bare string literals or template strings from the dropdown builders, bypassingtranslate().translate()with a stable key underauto.components.right.sidebar.source.control.dropdown.items.*. Dynamic parts use named i18next placeholders ({{baseRef}},{{authInstruction}},{{reviewLabel}}) instead of string concatenation, so translators get whole sentences. 25 keys are added toen.json.source-control-dropdown-commit-items.ts,source-control-dropdown-remote-items.ts,source-control-dropdown-review-items.ts,en.json, plus one test insource-control-dropdown-items.test.ts.Why
audit-localization-coverage.mjsonly inspects JSX attributes and object properties, not values returned from helper IIFEs, sopnpm verify:localization-coveragepassed while these strings shipped untranslated. The disabled-reason hints are the most actionable copy in the menu (they tell the user what to do next), so leaving them English in a localized build is the worst place for the gap. The translations are inlined at the call sites, which keeps them next to the logic that picks them, and no new module is needed.Linked Issue
N/A. No linked issue; this is a maintainer-landed version of #14127.
Visual Proof
N/A. English strings are unchanged, so the English UI looks the same. The new keys aren't in the non-English catalogs yet, so those locales show the English fallback until translations are synced. The behavior change (strings are now resolved through the active locale) is covered by the pseudo-localization test below.
Testing
Reproduced on
mainwith a pseudo-locale probe:Checking branch status…,Rebase from origin/main,Commit changes first, and the other 22 strings came back unbracketed, which shows they bypasstranslate(). On this branch the same probe returns all 25 bracketed.New test
routes Commit & Sync, Rebase, and Create PR blocked copy through the active localeswitches toPSEUDO_LOCALIZATION_LOCALEand asserts the Commit & Sync title, Rebase label (with{{baseRef}}interpolation), and Create PR hint are localized. It fails onmainand passes here.pnpm test src/renderer/src/components/right-sidebar/source-control-dropdown-items.test.ts: 31/31 pass. The existing English-wording assertions pass unchanged.pnpm verify:localization-coveragepasses.oxlintandoxfmt --checkare clean on the touched files.Platforms: macOS (unit tests). This change only touches renderer copy and has no platform-, SSH-, or path-specific behavior.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Original fix by @smwbev in #14127. I squashed it and simplified the copy so it's inlined at the builders with named placeholders. Authorship is preserved.
Agent skill upstream boundary
Notes
Security: interpolated values (git ref label, provider auth instruction, review label) are rendered as React text and
titleattributes. There is no HTML assembly. Cross-platform, SSH/remote, mobile, and mixed-version compat: renderer-only copy, with no IPC or protocol changes. Performance:translate()lookups only.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)