This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit 2eaf5be
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
- .changeset
- packages
- i18n/src/locales
- plugin-form/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3711 | 3711 | | |
3712 | 3712 | | |
3713 | 3713 | | |
| 3714 | + | |
| 3715 | + | |
| 3716 | + | |
| 3717 | + | |
| 3718 | + | |
3714 | 3719 | | |
3715 | 3720 | | |
3716 | 3721 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3675 | 3675 | | |
3676 | 3676 | | |
3677 | 3677 | | |
| 3678 | + | |
| 3679 | + | |
| 3680 | + | |
| 3681 | + | |
| 3682 | + | |
3678 | 3683 | | |
3679 | 3684 | | |
3680 | 3685 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4151 | 4151 | | |
4152 | 4152 | | |
4153 | 4153 | | |
| 4154 | + | |
| 4155 | + | |
| 4156 | + | |
| 4157 | + | |
| 4158 | + | |
| 4159 | + | |
| 4160 | + | |
| 4161 | + | |
| 4162 | + | |
| 4163 | + | |
| 4164 | + | |
| 4165 | + | |
| 4166 | + | |
| 4167 | + | |
| 4168 | + | |
| 4169 | + | |
| 4170 | + | |
| 4171 | + | |
| 4172 | + | |
4154 | 4173 | | |
4155 | 4174 | | |
4156 | 4175 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3679 | 3679 | | |
3680 | 3680 | | |
3681 | 3681 | | |
| 3682 | + | |
| 3683 | + | |
| 3684 | + | |
| 3685 | + | |
| 3686 | + | |
3682 | 3687 | | |
3683 | 3688 | | |
3684 | 3689 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3677 | 3677 | | |
3678 | 3678 | | |
3679 | 3679 | | |
| 3680 | + | |
| 3681 | + | |
| 3682 | + | |
| 3683 | + | |
| 3684 | + | |
3680 | 3685 | | |
3681 | 3686 | | |
3682 | 3687 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3677 | 3677 | | |
3678 | 3678 | | |
3679 | 3679 | | |
| 3680 | + | |
| 3681 | + | |
| 3682 | + | |
| 3683 | + | |
| 3684 | + | |
3680 | 3685 | | |
3681 | 3686 | | |
3682 | 3687 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3674 | 3674 | | |
3675 | 3675 | | |
3676 | 3676 | | |
| 3677 | + | |
| 3678 | + | |
| 3679 | + | |
| 3680 | + | |
| 3681 | + | |
3677 | 3682 | | |
3678 | 3683 | | |
3679 | 3684 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3674 | 3674 | | |
3675 | 3675 | | |
3676 | 3676 | | |
| 3677 | + | |
| 3678 | + | |
| 3679 | + | |
| 3680 | + | |
| 3681 | + | |
3677 | 3682 | | |
3678 | 3683 | | |
3679 | 3684 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3705 | 3705 | | |
3706 | 3706 | | |
3707 | 3707 | | |
| 3708 | + | |
| 3709 | + | |
| 3710 | + | |
| 3711 | + | |
| 3712 | + | |
3708 | 3713 | | |
3709 | 3714 | | |
3710 | 3715 | | |
| |||
0 commit comments