Skip to content

Commit 5c8afed

Browse files
claudeos-zhuang
authored andcommitted
fix(showcase): translate the object-less action, restoring the i18n ratchet
TypeScript Type Check went red on `check:i18n-coverage`, not on types: examples/app-showcase/objectstack.config.ts: untranslated declared strings grew 456 -> 458 That gate freezes each example's untranslated-string debt and fails the moment it grows. The new action declares exactly two strings — `label` and `successMessage` — so the +2 is mine. Translated rather than ratcheted. Raising the baseline to 458 would have made the gate green by widening the debt it exists to prevent, and there is in-file precedent against that: `showcase_action_param_gallery`'s `p_assignee` was "translated at birth" for this exact reason (#3405). The keys go under the bundle's top-level `globalActions` slot, which is the ONLY place the resolver looks for an action declaring no `objectName` — keys for such an action under `objects.*._actions` are never read. That slot had zero users anywhere in the repo before this, which follows from the same gap #3913 left: no object-less action existed to translate. So the specimen now also covers the object-less translation path. Verified the key genuinely resolves rather than being silently ignored: with the name misspelled, `os lint` reports `translation-target-unknown` at `translations[0].en.globalActions.showcase_portfolio_snapshotX` with a "Did you mean showcase_portfolio_snapshot?" suggestion; spelled correctly it is clean. check-i18n-coverage back to OK (none new, baseline untouched at 456), `os lint` 0 errors, tsc clean, eslint clean, 60 tests pass, build green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011AvZj6cLX7APd7roh2eK4F
1 parent a33c76e commit 5c8afed

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

  • examples/app-showcase/src/system/translations

examples/app-showcase/src/system/translations/index.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,17 @@ export const ShowcaseTranslationBundle = {
138138
label: 'Field Zoo', pluralLabel: 'Field Zoo',
139139
},
140140
},
141+
// The OBJECT-LESS action slot (framework#3913). `globalActions` is the only
142+
// place the resolver looks for an action that declares no `objectName` —
143+
// keys for such an action under `objects.*._actions` are never read. Before
144+
// `showcase_portfolio_snapshot` the showcase had no object-less action, so
145+
// this slot had no specimen anywhere in the repo.
146+
globalActions: {
147+
showcase_portfolio_snapshot: {
148+
label: 'Portfolio Snapshot',
149+
successMessage: 'Portfolio snapshot taken.',
150+
},
151+
},
141152
},
142153
'zh-CN': {
143154
objects: {
@@ -286,5 +297,16 @@ export const ShowcaseTranslationBundle = {
286297
},
287298
},
288299
},
300+
// See the `en` block: object-less actions resolve ONLY through
301+
// `globalActions`. Translated at birth for the same reason as
302+
// `showcase_action_param_gallery.params.p_assignee` above — this example is
303+
// ratcheted at its current untranslated count, so a new declared label that
304+
// skips zh-CN widens the debt and fails `check-i18n-coverage`.
305+
globalActions: {
306+
showcase_portfolio_snapshot: {
307+
label: '业务概览',
308+
successMessage: '已生成业务概览。',
309+
},
310+
},
289311
},
290312
};

0 commit comments

Comments
 (0)