… hint
The zh-CN /help panel left one of its eight group headers in English and
described /agent with 组稿, which is editorial copy ("compile a manuscript")
rather than "compose a request":
│ Registry -> │ 注册表
│ /agent │ /agent
│ 组稿一次性 Agent 请求 -> │ 编写一次性 Agent 请求
Registry becomes 注册表, the term the zh user guide already uses for every
other registry in the product ("远程技能注册表", "Clawhub 注册表 URL",
OpenClaw 的插件工具注册表); no zh doc or zh message uses the English word.
Hooks deliberately stays English. Issue 3336 allows either spelling and asks
for consistency with HelpSummaryHooks, and the zh catalog is unanimous:
Hook/Hooks appears 161 times across nine zh message files while 钩子 appears
nowhere in cosh-ng -- not in the entry rendered inside this very group
("显示 Hook 状态"), not in zh/health.rs' HealthCollectorHooks label ("Hooks"),
not in zh/hooks.rs' "已注册 {count} 个 Hook。" and not in zh/approval.rs'
"Hook 审查". Translating only the header would put 钩子 one line above
"显示 Hook 状态". Prompt is the same kind of loanword ("Prompt 草稿卡") and
stays for the same reason. Both decisions are now asserted in code instead of
being left to chance.
The panel was the only zh panel with no forbidden-label guard, which is how
this shipped: the other seven carry a *_ZH_FORBIDDEN_UI list in
tests/raw_cli/i18n.rs. Add HELP_ZH_FORBIDDEN_UI plus
raw_cli_help_renders_zh_group_titles, which renders /help under
COSH_SHELL_LANG=zh-CN and pins all eight headers, the /agent summary, and the
absence of the English titles. The en-US panel is untouched.
Tests (Linux x86_64, base main 713dc2f, rustc 1.96.0):
- cargo test -p cosh-shell --test raw_cli -- slash:: config:: mode:: i18n
gives 47 passed, 0 failed (new zh test + the existing en-US help test)
- cargo test -p cosh-shell --lib -- i18n:: gives 8 passed
- cargo fmt --all -- --check is clean
- cargo clippy -p cosh-shell --all-targets -- -D warnings is clean, 62.8s
- negative control 注册表 -> "Registry": the new test fails with
"missing zh group header 注册表"
- negative control 编写 -> 组稿: the new test fails at the 组稿一次性 assertion
- negative control 会话 -> "会话 Sessions": the new test fails with
"migrated English UI label leaked: Sessions", which exercises
HELP_ZH_FORBIDDEN_UI on its own
- rendered zh panel inspected: all eight headers correct, borders still
aligned (注册表 is 3 cells narrower than Registry), footer untouched
- cargo test -p cosh-shell --no-fail-fast (full) gives 5060 passed and
15 failed; every failure also fails on pristine main 713dc2f: the same
11 raw_cli zsh/PTY tests (7 passed / 11 failed on both), the same 2
lib+bin timing tests (1493/1 and 2732/1 on both), and 2 shell_host tests
that pass in isolation on both branch and baseline (parallel-load flakes)
- not run: other crates and the cosh-core/cosh-gateway suites, since no code
outside cosh-shell's zh help catalog and its raw_cli tests changed
Fixes agentic-os-org#3336
Co-authored-by: multica-agent <github@multica.ai>
背景
#3336:zh-CN 下
/help面板的 8 个分组标题里还有英文,/agent的摘要用了「组稿」这个编辑/新闻用语,读起来不通顺。修复前实际渲染:改动
src/cosh-ng/crates/cosh-shell/src/i18n/zh/help.rsHelpGroupRegistry:Registry→注册表;HelpSummaryAgent:组稿一次性 Agent 请求→编写一次性 Agent 请求;HelpGroupHooks保留Hooks并就地写明理由(+8 −2)src/cosh-ng/crates/cosh-shell/tests/raw_cli/i18n.rsHELP_ZH_FORBIDDEN_UI(8 条),补齐 help 面板缺失的英文残留守护(+14)src/cosh-ng/crates/cosh-shell/tests/raw_cli/slash.rsraw_cli_help_renders_zh_group_titles:在COSH_SHELL_LANG=zh-CN下渲染/help,钉住 8 个分组标题与/agent摘要,并断言英文标题不出现(+34)不改 en 目录,不改
slash/notices.rs里的内部分组 key(("Registry", MessageId::HelpGroupRegistry)是与hint.group比对的标识符,不是 UI 文案),不改 workflow。为什么 Registry 译成「注册表」
zh 用户指南里所有 registry 概念本来就叫「注册表」:「远程技能注册表」(
copilot-shell/skills.md)、「Clawhub 注册表 URL」(copilot-shell/configuration.md)、OpenClaw 的「插件工具注册表」(token-saving/agent-memory.md)。zh 文档和 zh 文案里没有任何一处使用英文 Registry,所以这是沿用既有术语,不是新造词。为什么 Hooks 保留英文(issue 允许的第二种做法)
#3336 原话是「
HelpGroupHooks→"钩子"(or keep"Hooks"if product convention prefers the English loanword, but it should be consistent withHelpSummaryHookswhich uses"Hook 状态")」。两个条件都成立:HelpSummaryHooks就是「显示 Hook 状态」;zh/health.rs的采集项标签是HealthCollectorHooks => "Hooks",zh/hooks.rs是「已注册 {count} 个 Hook。」,zh/approval.rs是「Hook 审查」。只把标题译成「钩子」,会让「钩子」正好压在「显示 Hook 状态」的上一行。
Prompt属于同类借词(「Prompt 草稿卡」),同理不动。这两个决定现在都写进了断言,不再靠运气。为什么顺手补守护测试
help 是唯一没有
*_ZH_FORBIDDEN_UI清单的 zh 面板:approval / details / provider_native / renderer / question / slash_config / mode 七个都有。这正是英文标题能一路发布出去的原因,按同样约定补齐后,新增分组不可能再悄悄带着英文标题落地。测试情况
环境:Linux x86_64;base = main
713dc2f8;rustc 1.96.0;Node v22.21.1。cargo test -p cosh-shell --test raw_cli -- slash:: config:: mode:: i18ncargo test -p cosh-shell --lib -- i18n::cargo fmt --all -- --checkcargo clippy -p cosh-shell --all-targets -- -D warnings负向对照(证明守护真的拦得住)
注册表→Registrymissing zh group header 注册表编写→组稿assert!(!normalized.contains("组稿一次性"))会话→会话 Sessionsmigrated English UI label leaked: Sessions(单独验证HELP_ZH_FORBIDDEN_UI生效)每次变异后都还原文件,最终
git status只剩上表 3 个改动文件。全量套件与基线对照
cargo test -p cosh-shell --no-fail-fast:5060 passed / 15 failed。15 个失败在未改动的 pristine main713dc2f8上完全同样地失败,与本次改动无关:fd_reader_waits_for_readiness_without_backoffactivity_tool_output_details_show_internal_output_ref_in_debugrelay::raw_relay_bash_shell_opaque_bytes_ignore_slash_route、termios::scripted_shell_exit_timeout_kills_foreground_group未运行:其他 crate 与 cosh-core / cosh-gateway 套件——本次改动只落在 cosh-shell 的 zh help 文案与其 raw_cli 测试内。
与在途 PR 的冲突核对
#3312是另一个改 cosh-shell i18n 的在途 PR:它改i18n/mod.rs(hunk 在@@111/@@126,tests 模块开头)、i18n/{en,zh,message_id}/health.rs,以及tests/raw_cli/slash.rs(hunk 在@@73,即 en-US help 用例内部)。本 PR 改i18n/zh/help.rs、tests/raw_cli/i18n.rs(#3312 未触及)和在slash.rs文件末尾追加的新用例,与 #3312 的 hunk 无文本重叠。Fixes #3336