fix(ci): widen the locale hygiene gate to its blind spots - #5180
Draft
orangeCatDeveloper wants to merge 1 commit into
Draft
fix(ci): widen the locale hygiene gate to its blind spots#5180orangeCatDeveloper wants to merge 1 commit into
orangeCatDeveloper wants to merge 1 commit into
Conversation
Locale shortcuts in Runtime Host copy and bot error handling could silently select the wrong language, while multiline native dialogs escaped the source gate. Use typed catalogs and explicit locale-aware rendering, then scan complete source files so these patterns cannot return. Generated-by: Claude Code Generated-by: Codex
orangeCatDeveloper
force-pushed
the
fix/locale-hygiene-coverage
branch
from
September 13, 2026 03:00
ce47b7e to
a965d52
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The locale hygiene gate had three blind spots, and each one already has a live instance behind it.
SCOPEcoveredapps/desktop/src,packages/core/srcandpackages/ui/src— notpackages/runtime-host/src. That is the one package whereconst zh = locale !== 'en'survives (client/host-handoff-copy.ts:33), the exact shapelocale-literal-compareexists to reject, in the only tree the rules never opened.Two patterns had no rule at all:
generalizedErrorMessage. That helper always rendersen(redaction.ts:293), so a Chinese fallback makes the surface switch language by error content: classifiable errors read English, unclassifiable ones read Chinese, on the same screen.The gate is a ratchet against the merge base, so this does not ask anyone to fix history: existing hits are grandfathered per (file, rule) and only growth fails.
Refs #2672
Verification
Baseline hits the ratchet now grandfathers, counted over
SCOPEat this commit:The four dialog literals are removed by #5179; this PR does not depend on it, and lands the rule whichever merges first. The
bot-incoming-main.tshit is real and stays: that whole bot-reply surface is hardcoded Chinese, so fixing it means giving it a catalog and a locale, which is its own change.Each new rule is tested against a positive case and the shapes it must not flag — an English fallback to the same helper (how logs and CLI output legitimately use it), a catalog lookup in the
titleposition, and atitleproperty outside a dialog call.Review focus
native-dialog-literalrecognizes a dialog call by aproperties: [within 400 characters of the literal, rather than by resolving the callee. Dialog options are the only place that key appears in this shape, and the alternative — an AST pass — would cost the check its install-free property, which is why it runs beforenpm ciin CI. It will miss ashowSaveDialogthat passes noproperties;filters-only save panels are not covered.AI use
Select exactly one:
Tool(s) and scope: Claude Code — measured the blind spots against the tree, wrote the rules and their tests, and wrote this description. The commit carries a
Generated-by: Claude Codetrailer.Checklist
Does this PR entail a change in behavior?