Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

Commit 2eaf5be

Browse files
fix(plugin-form): WizardForm's footer and step chrome resolve through the i18n catalogue (objectui#10999) (#11038)
Fixes #10999 Clause-②: no ## What `WizardForm`'s own chrome now resolves through the i18n catalogue instead of English literals. It goes through the wizard's existing `createSafeTranslation` hook (`useWizardTranslation`), the same factory plugin-form's other chrome uses (the `ModalForm` / `DrawerForm` discard dialog, `uploadGate`, `LineItemsPanel`, `occSave`). The hook's defaults table stays byte-identical to the `en` pack (`pnpm check:i18n-keys` compares the two), so a provider-less host still renders English. | String | Key | zh | |---|---|---| | Cancel | `common.cancel` (existing) | 取消 | | Back | `wizard.back` (new) | 上一步 | | Next | `common.next` (existing) | 下一步 | | Submitting… | `wizard.submitting` (new) | 提交中… | | Create / Update | `form.create` / `form.update` (existing) | 创建 / 更新 | | Step x of y | `form.stepOf` (existing; one interpolated key, `{{current}}` / `{{total}}`) | 第 1 步,共 3 步 | | `Step N` indicator fallback | `wizard.stepFallback` (new, `{{n}}`) | 第 1 步 | | step indicator `aria-label` "Progress" | `wizard.progressLabel` (new) | 进度 | | "No fields configured for this step" | `wizard.emptyStep` (new) | 此步骤未配置字段 | - An authored `cancelText` / `prevText` / `nextText` / `submitText` still wins verbatim (the same `||` as before). The four keys stay plain `string`: no schema key added, renamed or retyped. - `wizard.back` rather than `common.back`: zh `common.back` is 返回 (a page back), while a wizard's step back is 上一步, the term `grid.import.back` and `grid.bulk.back` already use. In the other eight packs `wizard.back` equals `common.back`. Each pack's `wizard.submitting` is its `flowRunner.submitting` value (the same action in the flow runner); there is no generic `submitting` key. - `form.stepOf` was already in all ten packs with nothing reading it: `pnpm check:i18n-dead-keys` listed it as confirmed dead at the merge base, and it is off that list now. Its zh value gains the spaces the zh pack's other position counters carry (`table.pageInfo`, `detail.recordOf`): 第{{current}}步 becomes 第 {{current}} 步. ### Two literals beyond the card's list (same file, same defect class) The card named the footer, the counter and the `Step N` fallback. Reading `WizardForm.tsx` on `origin/main` found two more strings of the same chrome: the step indicator's `aria-label="Progress"` and the empty-step notice "No fields configured for this step". Both are fixed here under the bounded in-place rule (same defect class, same file and claim, mechanical, same i18n gate family). The zh pin asserts both: the navigation landmark named 进度, and 此步骤未配置字段 on the field-less step. ### One English rendering change The in-flight label was typed `Submitting...` with three ASCII full stops. As a pack value it is `Submitting…` with U+2026, because `ellipsis-glyph-3878.test.ts` holds every pack value to that glyph. Every other English default renders the same text as before. The changeset says so. ## Pin `WizardForm.i18nChrome-10999.test.tsx` in `packages/plugin-form/src`, four cases under a real `I18nProvider`: - zh: 取消, 下一步, 第 1 步,共 2 步, the navigation landmark 进度 and the indicator label 第 1 步 on step 1; 上一步, 创建, 第 2 步,共 2 步 and 此步骤未配置字段 on the last step; 提交中… while `create` is in flight; and no English default anywhere in the rendered text. - zh, edit mode: 更新. - zh with all four author keys set: each renders as authored, and that button's localized default is absent. The case first waits for a probe outside the wizard to read the zh catalogue, so it runs under a live zh pack. - en: Cancel, Next, Step 1 of 2, Progress, Step 1, Back, Create, Submitting…. Red leg at `b20db4c5d`: `WizardForm.tsx` replaced by the merge-base blob (`5ebead81`, hash-checked on disk; the count of `t('common.cancel')` went from 1 to 0), everything else at HEAD: **3 failed, 1 passed**. Both zh-default cases fail with `Unable to find role="button" and name "下一步"`; the en case fails only at `name "Submitting…"` (the glyph change above); the authored case passes, because author values always won, so it is the must-not-change guard. Restored with `git checkout HEAD --` and verified by blob hash (`0aabde44` equals the HEAD blob) and an empty `git diff HEAD`. Green at the same head: 4 passed. ## Verification (all at `b20db4c5d`) - `pnpm exec vitest run packages/i18n/ packages/plugin-form/`: Test Files 211 passed (211), Tests 2806 passed, 14 skipped (2820). This includes `all-locales-key-parity`, `en-zh-key-parity`, `ellipsis-glyph-3878`, `untranslated-identity-4376` and `raw-key-call-sites-3546`. - `pnpm --filter @object-ui/plugin-form --filter @object-ui/i18n type-check`: both Done, after building the dependency closure with `pnpm --filter "@object-ui/plugin-form^..." build`. `tsc -p tsconfig.test.json --listFilesOnly` in `packages/plugin-form` lists the pin. - `pnpm check:i18n-keys` exit 0 (35 factory tables, 884 rows, 884 matching). `pnpm check:i18n-drift` exit 0 (0 en values changed, 5 keys added). `pnpm check:control-bytes` OK. `pnpm check:new-line-citations`: 0 new. `node scripts/check-changeset-presence.mjs` passes. `pnpm changeset:check` passes. `pnpm check:pending-changeset-literals` passes. `pnpm check:changeset-claims` (report-only) names two pending changesets that mention touched files, `6237-wizard-step-config-split` and `6661-app-launcher-nav-menu-renderers`: both re-read, both still true. - `scripts/__tests__`, derived with `git grep -l -E "WizardForm|i18n/src/locales|locales/en|plugin-form/src|plugin-form'|\.changeset" -- 'scripts/__tests__/*.test.ts'`: 36 files, Test Files 36 passed, Tests 1823 passed. - eslint on the 12 touched source files (`--format json` reports 12 files): 0 errors and 21 warnings, all on `WizardForm.tsx` and equal to the merge-base file's 21. Why the narrowing excludes nothing: `eslint.config.js` sets no `parserOptions.project` or `projectService` (no type-aware linting), and no rule under `eslint-rules/` reads another file, so this diff cannot move a verdict on an untouched file. The repo-wide `pnpm lint` is CI's. - Eager closure (Bundle Analysis): no import edge is added, because `WizardForm.tsx` already imported `createSafeTranslation` from `@object-ui/i18n`. The only eager bytes are the five new `en` rows: the minified `en` pack grows by 140 B, 35 B gzipped (esbuild, merge base against head). On a local console build, `pnpm check:eager-closure` passes: 3105.4 KB gzipped across 330 of 2446 chunks, headroom 44.0 KB, and `i18n-locale-en` at 40.9 KB against its 48.8 KB ceiling. `pnpm check:eager-locale-catalogues` exits 0. ## Acceptance notes (observed, not fixed here) The same family (hard-coded English in plugin-form), outside this card's claim: - Success feedback: the default toast `Created` / `Saved` (ObjectForm, WizardForm, MasterDetailForm) and the thank-you title `Thanks!` (ObjectForm, WizardForm, the console's `FormPage`). - Load states: `Loading form...` / `Error loading form` in ObjectForm, TabbedForm, SplitForm, WizardForm, DrawerForm and ModalForm. - `NAVIGATE_ON_SUCCESS_REFUSED_NOTE`, shared by ObjectForm and WizardForm. No zh render of these was measured in this run. Docs: the Multi-Step Form section of `content/docs/plugins/plugin-form.mdx` and `content/docs/api/schema-reference.md` do not state the chrome defaults, so no page becomes false; none is edited. Session: `https://claude.ai/code/session_01DuWo5bdP9SdVebamn99GGk` --- _Generated by [Claude Code](https://claude.ai/code/session_01DuWo5bdP9SdVebamn99GGk)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent f9b6dfe commit 2eaf5be

13 files changed

Lines changed: 332 additions & 14 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
'@object-ui/plugin-form': patch
3+
'@object-ui/i18n': patch
4+
---
5+
6+
`WizardForm`'s own chrome now reads the locale packs (objectui#10999). The
7+
default Cancel, Back, Next, Submitting, Create and Update labels, the
8+
"Step x of y" counter, the step indicator's label for a step that declares no
9+
`label`, the indicator's accessible name, and the notice on a step with no
10+
fields were English literals, so a wizard in a zh session showed `Cancel`,
11+
`Step 1 of 3` and `Next` beside a Chinese UI. They now resolve through the
12+
wizard's existing `createSafeTranslation` hook, the way the rest of
13+
plugin-form's chrome does.
14+
15+
An authored `cancelText`, `prevText`, `nextText` or `submitText` still renders
16+
exactly as authored, in every locale: only the defaults are localized, and the
17+
four keys stay plain strings.
18+
19+
Five of the strings reuse keys the packs already carried: `common.cancel`,
20+
`common.next`, `form.create`, `form.update`, and `form.stepOf`, a key that
21+
`pnpm check:i18n-dead-keys` listed as read by nothing until now. Five are new
22+
under `wizard.` in all ten packs: `back`, `submitting`, `stepFallback`,
23+
`progressLabel` and `emptyStep`. The wizard gets its own `back` rather than
24+
`common.back` because zh words a wizard's step back ("previous step", the term
25+
`grid.import.back` and `grid.bulk.back` already use) differently from a page's
26+
back ("return").
27+
28+
The zh value of `form.stepOf` gains the spaces around its numbers that the zh
29+
pack's other position counters, such as `table.pageInfo` and
30+
`detail.recordOf`, already carry.
31+
32+
**One rendered English string changes**: the final button's in-flight label was
33+
typed with three ASCII full stops and is now `Submitting…` with the typographic
34+
ellipsis, because it is a pack value now and `ellipsis-glyph-3878.test.ts`
35+
holds every pack value to U+2026. Every other English default renders the same
36+
text as before.

‎packages/i18n/src/locales/ar.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3711,6 +3711,11 @@ const ar = {
37113711
},
37123712
wizard: {
37133713
missingRequired: "يرجى إكمال الحقول المطلوبة: {{fields}}",
3714+
back: "رجوع",
3715+
submitting: "جارٍ الإرسال…",
3716+
stepFallback: "الخطوة {{n}}",
3717+
progressLabel: "التقدم",
3718+
emptyStep: "لا توجد حقول مهيأة لهذه الخطوة",
37143719
},
37153720
flowRunner: {
37163721
title: 'إدخال',

‎packages/i18n/src/locales/de.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3675,6 +3675,11 @@ const de = {
36753675
},
36763676
wizard: {
36773677
missingRequired: "Bitte füllen Sie die Pflichtfelder aus: {{fields}}",
3678+
back: "Zurück",
3679+
submitting: "Wird gesendet…",
3680+
stepFallback: "Schritt {{n}}",
3681+
progressLabel: "Fortschritt",
3682+
emptyStep: "Für diesen Schritt sind keine Felder konfiguriert",
36783683
},
36793684
flowRunner: {
36803685
title: 'Eingabe',

‎packages/i18n/src/locales/en.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4151,6 +4151,25 @@ const en = {
41514151
// comma-joined, already-truncated label list built at the call site.
41524152
wizard: {
41534153
missingRequired: 'Please complete the required fields: {{fields}}',
4154+
// The wizard's footer and step chrome (objectui#10999). The generic verbs
4155+
// it shows come from `common.cancel`, `common.next`, `form.create`,
4156+
// `form.update` and `form.stepOf`; these five are the wizard's own.
4157+
// The Previous-step button. Not `common.back`: some packs say a wizard's
4158+
// step back with a different word from a page's back (zh reads "previous
4159+
// step" here and "return" for `common.back`), and the wizard spelling is
4160+
// the one `grid.import.back` and `grid.bulk.back` already use.
4161+
back: 'Back',
4162+
// The final button while the record is being written.
4163+
submitting: 'Submitting…',
4164+
// The step indicator's label for a step that declares no `label`.
4165+
// `{{n}}` is the 1-based step number.
4166+
stepFallback: 'Step {{n}}',
4167+
// The step indicator's `aria-label` — what a screen reader calls the list
4168+
// of steps.
4169+
progressLabel: 'Progress',
4170+
// Shown in place of the fields on a step that has none (a final review
4171+
// step is the usual case).
4172+
emptyStep: 'No fields configured for this step',
41544173
},
41554174
// The screen-flow runner dialog (`app-shell/views/FlowRunner`) — the modal a
41564175
// `type: 'flow'` action opens when its run pauses at a `screen` node.

‎packages/i18n/src/locales/es.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3679,6 +3679,11 @@ const es = {
36793679
},
36803680
wizard: {
36813681
missingRequired: "Complete los campos obligatorios: {{fields}}",
3682+
back: "Atrás",
3683+
submitting: "Enviando…",
3684+
stepFallback: "Paso {{n}}",
3685+
progressLabel: "Progreso",
3686+
emptyStep: "No hay campos configurados para este paso",
36823687
},
36833688
flowRunner: {
36843689
title: 'Entrada',

‎packages/i18n/src/locales/fr.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3677,6 +3677,11 @@ const fr = {
36773677
},
36783678
wizard: {
36793679
missingRequired: "Veuillez renseigner les champs obligatoires : {{fields}}",
3680+
back: "Retour",
3681+
submitting: "Envoi…",
3682+
stepFallback: "Étape {{n}}",
3683+
progressLabel: "Progression",
3684+
emptyStep: "Aucun champ configuré pour cette étape",
36803685
},
36813686
flowRunner: {
36823687
title: 'Saisie',

‎packages/i18n/src/locales/ja.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3677,6 +3677,11 @@ const ja = {
36773677
},
36783678
wizard: {
36793679
missingRequired: "必須項目を入力してください: {{fields}}",
3680+
back: "戻る",
3681+
submitting: "送信中…",
3682+
stepFallback: "ステップ {{n}}",
3683+
progressLabel: "進捗",
3684+
emptyStep: "このステップにはフィールドが設定されていません",
36803685
},
36813686
flowRunner: {
36823687
title: '入力',

‎packages/i18n/src/locales/ko.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3674,6 +3674,11 @@ const ko = {
36743674
},
36753675
wizard: {
36763676
missingRequired: "필수 항목을 입력하세요: {{fields}}",
3677+
back: "뒤로",
3678+
submitting: "제출 중…",
3679+
stepFallback: "{{n}}단계",
3680+
progressLabel: "진행 상황",
3681+
emptyStep: "이 단계에 구성된 필드가 없습니다",
36773682
},
36783683
flowRunner: {
36793684
title: '입력',

‎packages/i18n/src/locales/pt.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3674,6 +3674,11 @@ const pt = {
36743674
},
36753675
wizard: {
36763676
missingRequired: "Preencha os campos obrigatórios: {{fields}}",
3677+
back: "Voltar",
3678+
submitting: "Enviando…",
3679+
stepFallback: "Etapa {{n}}",
3680+
progressLabel: "Progresso",
3681+
emptyStep: "Nenhum campo configurado para esta etapa",
36773682
},
36783683
flowRunner: {
36793684
title: 'Entrada',

‎packages/i18n/src/locales/ru.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3705,6 +3705,11 @@ const ru = {
37053705
},
37063706
wizard: {
37073707
missingRequired: "Заполните обязательные поля: {{fields}}",
3708+
back: "Назад",
3709+
submitting: "Отправка…",
3710+
stepFallback: "Шаг {{n}}",
3711+
progressLabel: "Прогресс",
3712+
emptyStep: "Для этого шага не настроены поля",
37083713
},
37093714
flowRunner: {
37103715
title: 'Ввод',

0 commit comments

Comments
 (0)