fix(i18n): emit expected-result codes from producers - #4551
Draft
orangeCatDeveloper wants to merge 1 commit into
Draft
fix(i18n): emit expected-result codes from producers#4551orangeCatDeveloper wants to merge 1 commit into
orangeCatDeveloper wants to merge 1 commit into
Conversation
orangeCatDeveloper
force-pushed
the
fix/locale-producer-codes
branch
2 times, most recently
from
September 2, 2026 08:40
a8bf743 to
6bc25db
Compare
Main-process and runtime producers emitted zh-only prose for expected results, so en users saw Chinese copy or presenters guessed the language with CJK regex sniffs. Producers now emit stable machine codes, with raw external error text passed through as verbatim detail fields. Typed per-locale catalogs in the renderer own the code-to-copy mapping, each with an explicit generic fallback for unknown codes.
orangeCatDeveloper
force-pushed
the
fix/locale-producer-codes
branch
from
September 2, 2026 16:46
6bc25db to
9eedd68
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.
Part of #2672
Draft until #4493 lands (renderer legacy files gaining catalog imports trip the architecture ratchet; the recorded violations are all catalog-shaped). Rebase + ledger
--writeonce the policy PR merges.Producers across the settings and bot domains emitted zh-only result strings, so English users either saw Chinese or — where consumers guarded with
/[㐀-鿿]/content sniffing — silently lost the information. Producers now emit stable machine codes ({code} unions or code tokens; IPC payloads stay locale-free), and the presenter catalogs map each union exhaustively per locale with an explicit unknown-code fallback. All four CJK-sniff sites die with their producers fixed (permission-center guidance filter, memory settings, data/proxy-test, oauth login flow); zh copy moved verbatim, en copy is new.Also swept in from the final repo scan: the dev-singleton dialog in
main.ts, the browser message-box close label, the artifact save / config export-import native dialog titles (wired through the main-process locale authority'scurrent()), all previously zh-only or inline-bilingual.Covered producers:
capability-snapshotreasons, memory ops,settings-storeproxy tests,github-copilot-subscription-service,test-connectionOAuth rate-limit,computer-use-hosthealth reasons; bot:bot-eventsreplies/status reasons,bot-testerror/hint pairs,wechat-bridgesetup hints, plus the zh-passthrough gates in the bot settings pages. Bot platform display names and zh command keyword sets are protocol/matching data and are untouched.Boundaries: the four legacy capability reason tokens keep their existing prose form (
'missing platform credentials', …) — #4524's health presenter maps that exact vocabulary, so renaming to snake_case is a coordinated follow-up, not smuggled in here. Bot-channel notices inbot-incoming-mainfollow the bot audience language and are annotated rather than re-plumbed.Verification: 48 files; four desktop tsconfigs + runtime/core/storage typecheck green; sniff regexes count in touched files: 0; new rendered-output tests (en+zh) for permission-center guidance, bot connection-test errors, and proxy-test results; independent subagent review — 1 fallback-symmetry finding fixed (unknown code now maps to the generic message in both locales), legacy-token findings deferred as above.