Command descriptions in the command registry are hardcoded English and do not follow the browser locale #1072
MoTingFeng
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
The slash-command menu (e.g.
/compact,/goal,/plan,/export,/permission,/feedback,/model) shows descriptions registered on the host side, which are hardcoded English strings. Everything else in the command UI is localized throughdsh-client-locale(thet()seat). There is no clean path for a non-English user to localize these descriptions without patchingnode_modulesor shadow-registering duplicate commands in an agent preset.Evidence
The official README acknowledges the gap.
packages/client/locale/README.md, under "Known Limitations": "Registry-held text reads its translation once — copy captured at registration time outside the slot render path (e.g. the/modelcommand description in the command registry) keeps the language it was registered under until re-registration; slot-rendered copy follows switches live."The command popup localizes everything except the descriptions. In
packages/client/ui-commands(builtdsh-client-ui-commands/lib/client.js), the popup renderst("overlay.aria"),t("search.placeholder"),t("retry"),t("status.*")(L947-991), while descriptions come verbatim fromremote.commands.list(sessionId)(L511).Host command packages hardcode English descriptions, e.g.:
packages/goal/command-goal/src/index.ts:'set or view the goal for a long-running task'packages/compaction/command-compact/src/index.ts:'Compact older conversation history'dsh-plan-mode,dsh-permission-presets,dsh-command-feedback,dsh-session-log-export: same hardcoded pattern.The official e2e golden snapshot expects exactly this:
apps/web/tests/snapshots/lifecycle-chrome/command-menu.expected.mdlists all seven entries with English descriptions —compact Compact older conversation history,goal set or view the goal for a long-running task,plan Enter or leave plan mode,permission Switch the permission preset (sandbox mode + approval policy),feedback record feedback about this session,export Download this Session log as a ZIP archive,model Select the model for this conversation.Proposal
description(and optionallyinput.hint) inctx.commands.register(...)to be either a string (backwards compatible) or a per-locale object, e.g.{ zh: "压缩较早的对话历史", en: "Compact older conversation history" }; and/orlocale.register(ns, { zh, en })) keyed by command name, and render via thet()seat so descriptions follow live locale switches.Either way,
remote.commands.listshould return the description for the current locale.Impact
node_modulesor shadow-register commands in agent presets purely to localize descriptions.Environment
All reactions