Repository navigation
Conversation
The Resource Manager tooltip and the remote-host count were built from bare literals inside helper functions, so they stayed English with a language pack active. Route them through translate() with stable keys. Host helpers move to ssh-status-copy.ts so SshStatusSegment.tsx keeps its headroom under the 400-line gate.
…its text The segment tinted that row by comparing the line against the English string, which stops matching the moment the copy comes from the catalog. Return the flag with the line so the tint survives translation.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughStatus-bar copy now uses localized catalog entries for Resource Manager, terminal sessions, workspace states, reconnect attempts, and SSH host counts. Resource Manager tooltip lines carry text and emphasis metadata, and the renderer uses that metadata for styling. SSH status rendering uses shared helpers for connected-host counts and connecting-state text. Tests verify tooltip structures, emphasis behavior, and required English localization values. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
|
Thanks @smwbev — I reproduced this independently and your diagnosis is right, including the point that I've opened #12478 with a fix that builds on yours. Credit where it's due: your Visual proof of exactly that, three states from one harness under a Japanese UI (before / localize-only / after) is in #12478. What #12478 adds on top:
Happy to close mine in favour of yours if you'd rather land the target catalogs and the sibling strings here instead. |
|
Thanks @nwparker — closing this in favour of #12478, and I appreciate you tracing the tint bug back rather than just landing your own version. Your PR is the better one to ship, for two reasons that are not close calls:
Two things that may save you a round trip. The plural mechanism may draw a review commentYou use Separately, and unrelated to which mechanism you pick: neither one produces CLDR plural categories for plugin language packs. Those register under a synthetic The helper-return sweep you set asideYou mentioned measuring 1056 candidates and leaving that half open — that number is dominated by noise, and a narrower cut is tractable. Scanning 87 functions, 214 literals. Heaviest files:
Spot-checking the top of that list: Treat 214 as an upper bound rather than a worklist: a tail of it is proper nouns that should stay English ( |
|
Superseded by #12478, which carries this fix plus the es/ja/ko/zh catalogs. |
…its English text
The tooltip tinted a row with `line === 'Space scan ready'`, so routing that
copy through the catalog silently dropped the tint in every translated build.
Return `{ text, emphasized }` and let the segment read the flag.
Adopted from #12439 by @smwbev.
Co-authored-by: Evgenii <[email protected]>
Co-authored-by: Orca <[email protected]>
…e-host count (#12478) * fix(i18n): localize the status bar Resource Manager tooltip and remote-host count The Resource Manager tooltip/aria label and the SSH segment's host count were assembled from bare English literals inside helper functions, so they stayed English under every non-English UI language while the labels around them translated. Route them through the catalog with _one/_other plural keys and whole-line messages (locales reorder and repunctuate the summary), and add en/es/ja/ko/zh entries. Root cause of the miss: audit-localization-coverage bailed on any ancestor binary expression whose operator was not `+`, which hid every string under a `cond && <JSX/>` guard or a `?? 'fallback'` — including this segment's 'Connecting…'. Only comparison operands are code, so keep `??`, `||` and `&&` walking, and localize the four real strings that surfaced. Co-authored-by: Orca <[email protected]> * fix(status-bar): flag the space-scan tooltip row instead of matching its English text The tooltip tinted a row with `line === 'Space scan ready'`, so routing that copy through the catalog silently dropped the tint in every translated build. Return `{ text, emphasized }` and let the segment read the flag. Adopted from #12439 by @smwbev. Co-authored-by: Evgenii <[email protected]> Co-authored-by: Orca <[email protected]> * fix(status-bar): key Resource Manager tooltip rows by role instead of array index Co-authored-by: Orca <[email protected]> --------- Co-authored-by: Orca <[email protected]>
…e-host count (stablyai#12478) * fix(i18n): localize the status bar Resource Manager tooltip and remote-host count The Resource Manager tooltip/aria label and the SSH segment's host count were assembled from bare English literals inside helper functions, so they stayed English under every non-English UI language while the labels around them translated. Route them through the catalog with _one/_other plural keys and whole-line messages (locales reorder and repunctuate the summary), and add en/es/ja/ko/zh entries. Root cause of the miss: audit-localization-coverage bailed on any ancestor binary expression whose operator was not `+`, which hid every string under a `cond && <JSX/>` guard or a `?? 'fallback'` — including this segment's 'Connecting…'. Only comparison operands are code, so keep `??`, `||` and `&&` walking, and localize the four real strings that surfaced. Co-authored-by: Orca <[email protected]> * fix(status-bar): flag the space-scan tooltip row instead of matching its English text The tooltip tinted a row with `line === 'Space scan ready'`, so routing that copy through the catalog silently dropped the tint in every translated build. Return `{ text, emphasized }` and let the segment read the flag. Adopted from stablyai#12439 by @smwbev. Co-authored-by: Evgenii <[email protected]> Co-authored-by: Orca <[email protected]> * fix(status-bar): key Resource Manager tooltip rows by role instead of array index Co-authored-by: Orca <[email protected]> --------- Co-authored-by: Orca <[email protected]>
Summary
The status bar renders the Resource Manager tooltip and the remote-host count from bare literals inside helper functions, so both stay English while everything around them is translated.
resource-manager-terminal-copy.tsbuilds the whole tooltip without touching the catalog:SshStatusSegment.tsxdoes the same for the collapsed segment:Why the coverage gate does not catch it.
audit-localization-coverage.mjsinspects JSX attributes and object properties, not values returned by helper functions, sopnpm verify:localization-coveragepasses while the strings ship untranslated. This is the same class of defect as #11826; that sweep counted 57 such helpers across the renderer, and this PR takes the status bar ones.What changed
Connecting…sync:localization-catalogadded 11 keys; nothing was removed or reworded (11948 → 11959, 0 deletions, 0 value changes). English wording is byte-identical.A latent bug this surfaces
The segment tinted one tooltip row by comparing it against the English text:
That comparison stops matching the moment the copy comes from the catalog, so simply routing the string through
translate()would have dropped the tint in every non-English build.getResourceManagerTooltipLinesnow returns{ text, emphasized }and the segment reads the flag. A test pins it so the text-matching pattern cannot come back.Notes on the approach:
sessionsGroupedByWorkspace,hostCountOther) rather than content hashes, matchingconfig/i18n-translation-source.md: "a feature developer adds a stable message ID and current English copy once".count.ssh-status-copy.tssoSshStatusSegment.tsxkeeps its headroom under the 400-line gate — the same split accepted in fix(i18n): localize status labels in settings and stats #11826.Screenshots
No visual change in English — every string keeps its exact English wording, so an English build renders identically.
The defect is only visible in a localized build. From a Russian language pack on current
main, before this PR — the tooltip and0 hostssit in English next to a fully translated status bar:Testing
pnpm lintpnpm typecheckpnpm testpnpm buildsrc/renderer/src/i18n/status-bar-copy-localization.test.tspins all 11 keys to their English text, so a helper that reverts to a bare literal fails the suite.resource-manager-terminal-copy.test.tsgains a case asserting that the space-scan row is flagged rather than recognized by its wording.The full suite reports 44520 passed with 20 pre-existing failures across 8 files —
omp-shell-wrapper.node-pty,ssh-posix-command-wrapper,updater,terminal-ime-hangul-syllable-flush,terminal-ime-xterm-composition-cancel,automation-schedules,external-automation-jobs-file, andmacos-computer-helper-owner-loss-processes. All of them reproduce on a cleanupstream/maincheckout on this machine (macOS, Node 26), and none touch the status bar or i18n. The status-bar suite specifically is green: 38 files, 268 tests.AI Review Report
Reviewed the diff for correctness, localization behavior, and cross-platform impact on macOS, Linux, and Windows.
line === 'Space scan ready'comparison described above. Routing the copy through the catalog without this change would have been a silent visual regression in every translated build — caught before pushing, and now covered by a test.Connecting…uses U+2026, already present in this file. The memory label (3.69 GB · Σ RSS) is produced upstream bymemoryMetricCopyand is passed through unchanged as an interpolation value on all platforms.resource-manager-terminal-copy.test.ts; the full status-bar suite (38 files, 268 tests) passes.Security Audit
memoryLabeloriginates from the daemon resource snapshot over IPC. It previously reached the DOM via template concatenation and now reaches it as an i18next interpolation value — the same data on the same path, no new source of untrusted input.interpolation.escapeValue: false, but these strings render as React text nodes ({line.text}), so React escapes them. NodangerouslySetInnerHTML, no HTML assembly.Notes
Plural forms are selected with a ternary because that is the existing convention. This keeps two-form languages working and leaves languages with more plural categories approximated, which is the subject of #12106 — no change to that is proposed here.