Skip to content

i18n(slash): localize 4 lagging slash handlers#448

Merged
esengine merged 1 commit into
mainfrom
i18n/slash-handlers
May 8, 2026
Merged

i18n(slash): localize 4 lagging slash handlers#448
esengine merged 1 commit into
mainfrom
i18n/slash-handlers

Conversation

@esengine

@esengine esengine commented May 8, 2026

Copy link
Copy Markdown
Owner

Why

Most handler files were already 80%+ i18n'd from prior work, but four files had drift / gaps. Quick survey of `grep -c 't("' src/cli/ui/slash/handlers/*.ts` flagged the laggers; this PR closes them.

What

File Gap Fix
`web-search-engine.ts` 0 t() calls — entire help text + switch confirmation hardcoded Whole new `handlers.webSearchEngine` namespace (~12 keys)
`mcp.ts` 5 hardcoded usage / unknown-server / "(none)" / reconnect-not-wired strings Added under `handlers.mcp`
`plans.ts` Archive row template (`✓ {when} {N} steps · …`), "complete" verb, /stop abort line Added under `handlers.plans`
`semantic.ts` Code-mode-only refusal + "checking…" status Added under `handlers.semantic`

zh-CN translations included for all ~22 new keys.

Note on `semantic.ts`

This file already uses `t` from `@/index/semantic/i18n.js` for its rich status renderer (slashHeader, slashEnabled, etc.). The new two strings need the main `@/i18n/index` instead, so I aliased it as `tMain` rather than rename the existing `t`. Two t() instances side-by-side looks odd but the alternative would have been a 50-line rename.

Test plan

  • Full suite 2301 pass — vitest `setupFiles` pins runtime to EN
  • tsc + biome clean
  • No new tests added — these are status-line outputs without dedicated assertions

Status of the i18n sweep

After this lands, the surface that was flagged in the original audit is fully covered:

  1. ✅ `src/loop/errors.ts` (i18n(loop/errors): localize DeepSeek error messages #444)
  2. ✅ `src/loop.ts` yields (i18n(loop): localize 14 user-facing yields in step() #445)
  3. ✅ `src/loop/hook-events.ts` + `src/loop/force-summary.ts` (i18n(hooks/summary): localize hook outcome and force-summary text #446)
  4. ✅ `src/cli/ui/App.tsx` slash output (i18n(app): localize ~26 user-facing strings in App.tsx #447)
  5. ✅ `src/cli/ui/slash/handlers/*` (this PR)
  6. ✅ Wizard first-launch language picker (feat(wizard): first-launch language picker + i18n the wizard #442)
  7. ✅ Dashboard plan idle pill (i18n(dashboard): translate the plan 'idle' status pill #443)

Plus the 5xx friendly error UX from the original red-apple bug report (#440).

Anything still hardcoded after this is incidental (small-bite next-time fixes), not the systemic class of "Chinese user sees raw English."

Most handler files were already 80%+ i18n'd from prior work, but
four files had drift:

  - web-search-engine.ts — 0 t() calls, the entire help text plus
    switch confirmation was hardcoded English. Whole new
    handlers.webSearchEngine namespace (~12 keys).
  - mcp.ts — 5 hardcoded usage / unknown-server / "(none)" /
    reconnect-not-wired strings; added under handlers.mcp.
  - plans.ts — the archive row template ("✓ {when} {N} steps · …"),
    "complete" verb, and the /stop abort line. Added under
    handlers.plans.
  - semantic.ts — code-mode-only refusal + "checking…" status.
    Added under handlers.semantic. Note this file uses two t()
    instances side-by-side — the local @/index/semantic/i18n one
    stays for the existing slashHeader/slashEnabled keys, and the
    main @/i18n/index t (aliased as tMain) is added for the two new
    strings.

zh-CN translations included for all ~22 new keys.

Test plan: full suite 2301 pass, tsc + biome clean.
@esengine esengine merged commit 3f3b5e2 into main May 8, 2026
3 checks passed
@esengine esengine deleted the i18n/slash-handlers branch May 8, 2026 12:14
ChasLui pushed a commit to ChasLui/DeepSeek-Reasonix that referenced this pull request May 23, 2026
Most handler files were already 80%+ i18n'd from prior work, but
four files had drift:

  - web-search-engine.ts — 0 t() calls, the entire help text plus
    switch confirmation was hardcoded English. Whole new
    handlers.webSearchEngine namespace (~12 keys).
  - mcp.ts — 5 hardcoded usage / unknown-server / "(none)" /
    reconnect-not-wired strings; added under handlers.mcp.
  - plans.ts — the archive row template ("✓ {when} {N} steps · …"),
    "complete" verb, and the /stop abort line. Added under
    handlers.plans.
  - semantic.ts — code-mode-only refusal + "checking…" status.
    Added under handlers.semantic. Note this file uses two t()
    instances side-by-side — the local @/index/semantic/i18n one
    stays for the existing slashHeader/slashEnabled keys, and the
    main @/i18n/index t (aliased as tMain) is added for the two new
    strings.

zh-CN translations included for all ~22 new keys.

Test plan: full suite 2301 pass, tsc + biome clean.
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