Skip to content

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

Draft
orangeCatDeveloper wants to merge 3 commits into
apache:mainfrom
orangeCatDeveloper:fix/locale-producer-codes
Draft

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

Conversation

@orangeCatDeveloper

@orangeCatDeveloper orangeCatDeveloper commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Settings-area producers emitted zh-only result strings, so English users either saw Chinese or — where consumers guarded with /[㐀-鿿]/ content sniffing — silently lost the information (permission guidance was dropped entirely). Producers now emit stable machine codes (IPC payloads stay locale-free), and each settings catalog maps its union exhaustively per locale with an explicit unknown-code fallback. Every CJK-sniff site in this area dies with its producer fixed; zh copy moved verbatim, en copy is new.

Covered producers: capability-snapshot reasons, memory ops, test-connection OAuth rate-limit, computer-use-host health reasons, the GitHub Copilot import path (github-copilot-local-credential + its IPC handler, re-based onto main's device-grant rewrite), plus the dev-singleton dialog, browser message-box close label, and artifact/config native dialog titles (wired through the main-process locale authority). subscriptionResultMessage now takes the result envelope and resolves code, then the typed reason (experimental_disabled), through the catalog before falling back to the keyword classifier; its trailing CJK passthrough is gone. It moved out of the useOAuthLoginFlow hook module into the catalog module beside the copy it renders, which also makes it testable from node.

The bot domain moved to its own PR so each PR is one reviewer context.

Refs #2672

Verification

apps/desktop typecheck (4 tsconfigs):   0 errors
workspace typecheck:                    0 errors
desktop main tests (dist):              2000 pass / 0 fail
rendered-output tests (en+zh):          Copilot code, experimental_disabled reason, unknown code → fallback
packages/core tests:                    774 pass / 0 fail
CJK-sniff regexes in touched files:     0 remaining
zh literals in copilot producers:       0 remaining (was 8)
renderer architecture check:            passed against origin/main
biome (changed files):                  clean

Boundaries: the four legacy capability reason tokens keep their existing prose form — #4524's health presenter maps that exact vocabulary, so renaming is a coordinated follow-up.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: Claude Code — analysis, implementation, tests, and this description, under the contributor's direction; the commit carries a Generated-by: Claude Code trailer.

Checklist

  • Tests cover the change and fail without it

@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 7 times, most recently from ad2b11d to 89c58cd Compare September 3, 2026 08:49
@orangeCatDeveloper orangeCatDeveloper changed the title fix(i18n): emit expected-result codes from producers fix(i18n): emit settings expected-result codes from producers Sep 3, 2026
Settings-area producers (memory, data, permission center, connection
test, computer-use health, dev dialogs) emitted zh prose that reached en
users verbatim, and presenters sniffed CJK to decide whether to show it.
Producers now return stable codes; each settings catalog maps its codes
per locale with an explicit unknown fallback.

Generated-by: Claude Code
Gate the remaining CJK passthrough to zh, drop silent locale defaults, redact probe detail at the producer, and remove dead copy.

Generated-by: Muse Spark
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