feat(i18n): localize user-facing slash-command output (display-only) - #142
Open
ranxianglei wants to merge 1 commit into
Open
feat(i18n): localize user-facing slash-command output (display-only)#142ranxianglei wants to merge 1 commit into
ranxianglei wants to merge 1 commit into
Conversation
Add zh/en localization for the display layer: command descriptions, /acp-decompress and /acp-search results, and the /acp status report body. Scope is deliberately DISPLAY-ONLY. Model-facing text — tool descriptions, system prompts, and nudge reports injected to the model — stays English, because translating model instructions risks degrading compression/nudge quality. The nudge.compressedBlocks / nudge.minChars keys from #119 are intentionally NOT included. Locale resolution: explicit acp.json "language" override wins, else LC_ALL/LANG detection (LC_ALL overrides LANG, per Unix convention — fixes #119 which only checked LC_ALL when LANG was unset). Commands are re-registered after acp.json loads so descriptions pick up the configured locale within the same session. language lives on AdapterConfig (not spread into kernel Config) to avoid the layering leak #119 carried via module augmentation. Extracted from #119 (lsmir2).
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.
What
Add zh/en localization for the display layer — slash-command descriptions,
/acp-decompress&/acp-searchresults, and the/acpstatus report body.Scope is deliberately DISPLAY-ONLY
Model-facing text (tool descriptions, system prompts, nudge reports injected to the model) stays English — translating model instructions risks degrading compression/nudge quality. The
nudge.compressedBlocks/nudge.minCharskeys from #119 are intentionally excluded.Behavior
acp.json"language"override wins; elseLC_ALL/LANGdetection.LC_ALLnow correctly overridesLANG(per Unix convention). feat: /compact 走 ACP 压缩管线 + i18n + usageTriggerPercent #119 usedLANG ?? LC_ALL, soLC_ALLwas only checked whenLANGwas unset — effectively never, sinceLANGis virtually always set.acp.jsonloads (registerCommandshelper), so descriptions pick up the configured locale within the same session.languagelives onAdapterConfig(not spread into kernelConfig) — avoids the layering leak feat: /compact 走 ACP 压缩管线 + i18n + usageTriggerPercent #119 carried viadeclare module "acp-kernel".Files
src/i18n.ts— infra + display keys (zh/en), no model-injected keyssrc/commands.ts— wrap strings witht()src/index.ts—registerCommandsextraction +setLocaleat session_startsrc/config.ts—language?: "zh" | "en"on AdapterConfigsrc/user-config.ts— whitelisted foracp.jsontests/i18n.test.ts— 5 testsValidation
typecheck ✓ / 280 tests pass (5 new) ✓ / build ✓
Note
The decorative ASCII box header (
ACP Context Analysis) stays English (treated as a brand/title; also avoids CJK glyph-width alignment issues in the box). The/acp-settingsinteractive menu from #119 is a separate feature (FilterSelectList + 320 lines) and is not part of this PR. Extracted from #119 (thanks @21307369).