Skip to content

feat(wizard): first-launch language picker + i18n the wizard#442

Merged
esengine merged 1 commit into
mainfrom
feat/wizard-language-picker
May 8, 2026
Merged

feat(wizard): first-launch language picker + i18n the wizard#442
esengine merged 1 commit into
mainfrom
feat/wizard-language-picker

Conversation

@esengine

@esengine esengine commented May 8, 2026

Copy link
Copy Markdown
Owner

Why

Two related gaps for non-English first-runs:

  1. No language picker on first launch — the only way to switch was discovering the /language slash command after finishing setup in English. Intl.DateTimeFormat().resolvedOptions().locale is unreliable: terminal envs strip LANG, CI returns "C", some Mac configs land on en-US even with Chinese system language.
  2. The wizard itself was hardcoded English — even if a user typed /language zh-CN mid-flow, every subsequent wizard screen still rendered in English.

What

Language step

  • New first step of the wizard (before API key)
  • Cursor defaults to detectSystemLanguage() result, marked (detected)
  • Selection calls setLanguage() + notifyLanguageChange() immediately, so review/saved steps render in the chosen language
  • Re-runs (reasonix setup) start at the language step too — cursor defaults to the saved language so Enter is a no-op for users who don't want to change

Wizard i18n

~30 keys under a new wizard.* namespace, EN + zh-CN translations:

  • title / footer for every step
  • API key prompts, validation errors, redacted preview format
  • MCP catalog hints, args step (including the "create directory?" branch)
  • review step labels (Language / API key / Preset / MCP), save error format
  • saved screen + step counter

Reuses t("ui.welcome") for the post-save line that already had a translation.

Test plan

  • ink-testing-library renders Wizard, confirms language step is shown first with both options visible
  • zh-CN runtime switch test confirms title translates ("选择语言")
  • buildSpec round-trip tests still pass (4 existing + 2 new = 6)
  • Full suite 2295 passing (was 2293 before + 2 new wizard tests)
  • tsc + biome clean
  • Renamed tests/wizard.test.tstests/wizard.test.tsx since it now contains JSX

Independent of #440 / #441

This branch is off main and doesn't touch errors.ts. Mergeable in any order relative to the other two.

Two related fixes for non-English first-runs:

1. Add a language step at the very start of the setup wizard.
   Cursor defaults to detectSystemLanguage() result. Selection saves
   immediately, so all later wizard steps render in the chosen
   language. Re-runs (`reasonix setup`) start there too — cursor
   defaults to currently saved language so Enter is a no-op for
   users who don't want to change it.

2. Localize every hardcoded string in the wizard via a new wizard.*
   i18n namespace (~30 keys, EN + zh-CN). Previously a Chinese user
   who hit /language partway through never saw zh-CN copy because
   the wizard rendered raw English. Now language → applies → review
   step renders in zh-CN.

Why this matters: Intl.DateTimeFormat().resolvedOptions().locale
isn't always correct (terminal env strips LANG, CI returns "C", etc.),
and the prior workflow only let users discover /language *after*
finishing setup in English.

Tests: ink-testing-library renders the Wizard and confirms the
language step is shown first with both options visible, in EN and
zh-CN. wizard.test.ts → wizard.test.tsx (now contains JSX).
@esengine esengine merged commit db194cb into main May 8, 2026
3 checks passed
@esengine esengine deleted the feat/wizard-language-picker branch May 8, 2026 11:22
ChasLui pushed a commit to ChasLui/DeepSeek-Reasonix that referenced this pull request May 23, 2026
…e#442)

Two related fixes for non-English first-runs:

1. Add a language step at the very start of the setup wizard.
   Cursor defaults to detectSystemLanguage() result. Selection saves
   immediately, so all later wizard steps render in the chosen
   language. Re-runs (`reasonix setup`) start there too — cursor
   defaults to currently saved language so Enter is a no-op for
   users who don't want to change it.

2. Localize every hardcoded string in the wizard via a new wizard.*
   i18n namespace (~30 keys, EN + zh-CN). Previously a Chinese user
   who hit /language partway through never saw zh-CN copy because
   the wizard rendered raw English. Now language → applies → review
   step renders in zh-CN.

Why this matters: Intl.DateTimeFormat().resolvedOptions().locale
isn't always correct (terminal env strips LANG, CI returns "C", etc.),
and the prior workflow only let users discover /language *after*
finishing setup in English.

Tests: ink-testing-library renders the Wizard and confirms the
language step is shown first with both options visible, in EN and
zh-CN. wizard.test.ts → wizard.test.tsx (now contains JSX).
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