Skip to content

feat(cli): add a locale authority for primary TUI guidance #2554

Description

@me2seeks

Context

Part of #2672.

The original bug is still present: a fresh TUI starts with Chinese welcome copy, while slash autocomplete and help switch to English. The RFC now settles the broader product boundary, so this issue can fix the inconsistency without inventing a Desktop dependency or a global command-line flag.

Decision

  • do not add a discoverable maka --locale option
  • use MAKA_LOCALE=zh, en, or auto as the explicit CLI-client preference
  • resolve auto from LC_ALL, then LC_MESSAGES, then LANG
  • do not read Desktop settings; the TUI is an independent client
  • keep command tokens, model and provider names, paths, user content, model output, JSONL, protocol values, logs, and exit semantics locale-independent
  • reject an unsupported explicit MAKA_LOCALE value with a clear configuration error

Proposed slice

Add a small CLI locale resolver based on the shared core locale model, pass the resolved locale into the TUI, and move the primary guidance into a typed, CLI-owned catalog:

  • welcome and first-send guidance
  • slash autocomplete descriptions
  • help headings, command descriptions, and keybinding guidance

Picker copy, onboarding, runtime notices, error presentation, and non-interactive CLI help remain separate follow-ups.

Acceptance criteria

  • explicit zh and en select the corresponding TUI guidance
  • auto follows the supported POSIX locale variables in the documented priority order
  • slash command tokens remain unchanged
  • the welcome surface, autocomplete, and help use the same resolved locale
  • machine-readable and Runtime Host contracts do not change
  • focused tests cover explicit selection, auto fallback, invalid configuration, and both catalogs

I plan to implement this slice.

中文说明

本 Issue 现在作为 #2672 的第一个 CLI/TUI slice:不新增 maka --locale 参数,而是使用 MAKA_LOCALE 作为显式偏好,auto 按 LC_ALL、LC_MESSAGES、LANG 的顺序解析。TUI 不读取 Desktop 设置。

本次只统一欢迎页、斜杠命令补全和帮助/键位说明;命令 token、模型与供应商名称、路径、用户和模型内容,以及 JSONL、协议、日志和退出语义保持不变。Picker、onboarding、运行通知、错误呈现及非交互 CLI help 后续独立迁移。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions