Skip to content

fix(i18n): localize Commit & Sync, Rebase, and Create PR hints in the source control dropdown - #14127

Merged
nwparker merged 1 commit into
stablyai:mainfrom
smwbev:fix/localize-source-control-dropdown-hints
Oct 26, 2026
Merged

nwparker merged 1 commit into
stablyai:mainfrom
smwbev:fix/localize-source-control-dropdown-hints

Conversation

@smwbev

@smwbev smwbev commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Before: the Commit & Sync tooltip (7 states), the Rebase label and tooltip (5 strings), and the Create PR blocked hints (every HostedReviewCreationBlockedReason plus loading / not-ready fallbacks) were returned as bare string literals or template strings from the dropdown builders, bypassing translate().
  • After: each of those strings goes through translate() with a stable key under auto.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 to en.json.
  • Files: source-control-dropdown-commit-items.ts, source-control-dropdown-remote-items.ts, source-control-dropdown-review-items.ts, en.json, plus one test in source-control-dropdown-items.test.ts.
  • English wording is byte-for-byte unchanged, so the English UI renders identically.

Why

audit-localization-coverage.mjs only inspects JSX attributes and object properties, not values returned from helper IIFEs, so pnpm verify:localization-coverage passed 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 main with 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 bypass translate(). On this branch the same probe returns all 25 bracketed.

  • New test routes Commit & Sync, Rebase, and Create PR blocked copy through the active locale switches to PSEUDO_LOCALIZATION_LOCALE and asserts the Commit & Sync title, Rebase label (with {{baseRef}} interpolation), and Create PR hint are localized. It fails on main and 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-coverage passes. oxlint and oxfmt --check are 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

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Security: interpolated values (git ref label, provider auth instruction, review label) are rendered as React text and title attributes. 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

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@smwbev
smwbev requested a review from brennanb2025 as a code owner August 13, 2026 00:32
@coderabbitai

coderabbitai Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Reviews paused

It 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 reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
Walkthrough

Source-control dropdown messages for commit synchronization, rebasing, and hosted-review blockers now use translation keys. English locale entries cover the labels and blocked states. A new test switches to pseudo-localization and checks selected dropdown messages, then restores English.

Priority: Low

Merge Risk: Low · up to f615e

Restore the original locale so this test cannot affect later tests or UI behavior.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 6 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: localizing Commit & Sync, Rebase, and Create PR hints in the source control dropdown.
Description check Passed The description follows the required template and explains the user impact, implementation, rationale, issue context, visual-proof exception, testing, security, compatibility, and checklist status. It…
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.
Full details: Description check

Explanation

The description follows the required template and explains the user impact, implementation, rationale, issue context, visual-proof exception, testing, security, compatibility, and checklist status. It is sufficiently complete for review.

Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 6 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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 commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

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]>
@nwparker
nwparker force-pushed the fix/localize-source-control-dropdown-hints branch from 02c99eb to f615ed2 Compare October 26, 2026 15:48
@nwparker nwparker changed the title fix(i18n): localize the source control dropdown hints fix(i18n): localize Commit & Sync, Rebase, and Create PR hints in the source control dropdown Oct 26, 2026

@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


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
Commits

Reviewing files that changed from the base of the PR and between 02c99eb and f615ed2.

Files selected for processing: 5
  • src/renderer/src/components/right-sidebar/source-control-dropdown-commit-items.ts
  • src/renderer/src/components/right-sidebar/source-control-dropdown-items.test.ts
  • src/renderer/src/components/right-sidebar/source-control-dropdown-remote-items.ts
  • src/renderer/src/components/right-sidebar/source-control-dropdown-review-items.ts
  • src/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.

@nwparker
nwparker merged commit 7989497 into stablyai:main Oct 26, 2026
33 checks passed
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