Skip to content

fix(i18n): emit expected-result codes from producers - #4551

Draft
orangeCatDeveloper wants to merge 1 commit into
apache:mainfrom
orangeCatDeveloper:fix/locale-producer-codes
Draft

fix(i18n): emit expected-result codes from producers#4551
orangeCatDeveloper wants to merge 1 commit into
apache:mainfrom
orangeCatDeveloper:fix/locale-producer-codes

Conversation

@orangeCatDeveloper

@orangeCatDeveloper orangeCatDeveloper commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

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 --write once 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's current()), all previously zh-only or inline-bilingual.

Covered producers: capability-snapshot reasons, memory ops, settings-store proxy tests, github-copilot-subscription-service, test-connection OAuth rate-limit, computer-use-host health reasons; bot: bot-events replies/status reasons, bot-test error/hint pairs, wechat-bridge setup 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 in bot-incoming-main follow 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.

@github-actions github-actions Bot added the effort/XL Over 1000 readable lines label Sep 2, 2026
@orangeCatDeveloper
orangeCatDeveloper force-pushed the fix/locale-producer-codes branch 2 times, most recently from a8bf743 to 6bc25db Compare September 2, 2026 08:40
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/XL Over 1000 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant