Skip to content

feat(i18n): localize user-facing slash-command output (display-only) - #142

Open
ranxianglei wants to merge 1 commit into
masterfrom
2026-08-13_i18n-display
Open

feat(i18n): localize user-facing slash-command output (display-only)#142
ranxianglei wants to merge 1 commit into
masterfrom
2026-08-13_i18n-display

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

What

Add zh/en localization for the display layer — slash-command descriptions, /acp-decompress & /acp-search results, and the /acp status 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.minChars keys from #119 are intentionally excluded.

Behavior

Files

  • src/i18n.ts — infra + display keys (zh/en), no model-injected keys
  • src/commands.ts — wrap strings with t()
  • src/index.tsregisterCommands extraction + setLocale at session_start
  • src/config.tslanguage?: "zh" | "en" on AdapterConfig
  • src/user-config.ts — whitelisted for acp.json
  • tests/i18n.test.ts — 5 tests

Validation

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-settings interactive menu from #119 is a separate feature (FilterSelectList + 320 lines) and is not part of this PR. Extracted from #119 (thanks @21307369).

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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant