fix(i18n): emit bot expected-result codes from producers - #4639
Open
orangeCatDeveloper wants to merge 5 commits into
Open
fix(i18n): emit bot expected-result codes from producers#4639orangeCatDeveloper wants to merge 5 commits into
orangeCatDeveloper wants to merge 5 commits into
Conversation
orangeCatDeveloper
force-pushed
the
fix/locale-bot-codes
branch
12 times, most recently
from
September 5, 2026 04:58
1518efa to
560790e
Compare
This was referenced Sep 5, 2026
orangeCatDeveloper
force-pushed
the
fix/locale-bot-codes
branch
2 times, most recently
from
September 5, 2026 08:07
dbe95db to
ae17f95
Compare
Bot test, onboarding, and bridge producers emitted zh prose that reached en users verbatim, and the renderer sniffed CJK to decide whether to show it. Producers now return stable codes; the settings-bot catalog maps each code per locale with an explicit unknown fallback, and each locale owns its complete allowlist warning and help messages. Generated-by: Claude Code Claude-Session: https://claude.ai/code/session_01AqdSkg56F2x55wEGRWvzcB
Generated-by: OpenCode
orangeCatDeveloper
force-pushed
the
fix/locale-bot-codes
branch
from
September 5, 2026 11:27
ae17f95 to
b87baf2
Compare
Keep platform-specific credential failures and transient errors distinct across probes, status updates, and onboarding. Present stable codes with localized fallbacks while retaining redacted diagnostics in logs. Generated-by: OpenCode
Bridges reported missing credentials with legacy kebab reasons while the connection test used snake codes for the same failures, so the presenter carried alias entries for both spellings. Generated-by: Claude Code
orangeCatDeveloper
marked this pull request as ready for review
September 5, 2026 12:19
knip lists the desktop workspace's dependencies, and `typeof import()` of undici and the Slack SDKs counted as unlisted ones. Generated-by: Claude Code
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
Bot producers (
bot-testerror/hint pairs,bot-eventsreplies and status reasons,wechat-bridgesetup hints, bot onboarding) emitted zh-only strings, so English users either saw Chinese or — where the bot settings pages guarded with/[㐀-鿿]/content sniffing — silently lost the information. Producers now emit stable machine codes;settings-bot-copymaps each union exhaustively per locale with an explicit unknown-code fallback, and the zh-passthrough gates in the bot settings pages are gone. zh copy moved verbatim, en copy is new. Bot platform display names and zh command keyword sets are protocol/matching data and are untouched; bot-channel notices follow the bot audience language and are annotated rather than re-plumbed.packages/core/redaction.tsis restructured on the way: the keyword classifier becomesclassifyGeneralizedError() → GeneralizedErrorClass(bot onboarding emits the class as its code), and the two hand-mirrored en/zh message maps collapse into oneUiCatalog<Record<GeneralizedErrorClass, string>>behindgeneralizedErrorMessageForLocale(…, locale).generalizedErrorMessagestays as the en wrapper for its callers; the zh-CN and zh-TW wrappers are removed and their last caller goes through the locale form. Adding a locale now means adding one catalog block, not a third classifier.Split out of #4551 so each PR is one reviewer context. main now ships
generalizedErrorMessageForLocale; this PR keeps its signature and adds the exported classifier and code union.Allowlist warnings and help text are complete per-locale formatters rather than UI-assembled fragments. Each locale owns the three-ID preview and count wording: Chinese retains its total-count phrasing, while English now reports only the omitted IDs as remaining. The adjacent limit-reached help follows the same complete-message rule.
Refs #2672
Verification
Follow-up verification: 26 bot-detail rendering and settings-copy tests pass, including all three locales, empty lists, overflow counts, and the allowlist limit. Desktop build and all four typechecks, repository format/lint, and the renderer architecture check pass.
Four invalid IDs, with the first three shown:
AI use
Select exactly one:
Tool(s) and scope: Claude Code — analysis, implementation, tests, and this description, under the contributor's direction; the commit carries a
Generated-by: Claude Codetrailer.OpenCode implemented the complete allowlist messages and count fix, added rendering tests, and updated this description; the follow-up commit carries
Generated-by: OpenCode.Checklist