diff --git a/.changeset/translation-actions-convention-docblock-keys.md b/.changeset/translation-actions-convention-docblock-keys.md new file mode 100644 index 0000000000..54b9abb1b6 --- /dev/null +++ b/.changeset/translation-actions-convention-docblock-keys.md @@ -0,0 +1,14 @@ +--- +"@objectstack/spec": patch +--- + +Documentation: the `_actions` and `globalActions` convention lists in `translation.zod.ts` now name every key the schema accepts. + +Both docblocks are hand-written prose copies of what one factory declares. `actionTranslationSchema(...)` builds both surfaces — the file says so outright, "Shared by object `_actions` and `globalActions`" — so the two lists carried the identical four addresses (`label`, `confirmText`, `successMessage`, `resultDialog.*`) and the identical two omissions. An author reading either list to learn which keys exist saw a strict subset of what the schema has accepted all along. + +Added to both lists, in the order the factory declares them and matching the spelling already landed in `i18n-resolver.ts`'s own header: + +- `description` — the explanatory line under the title in the action's param dialog, resolved at `objects.._actions..description` with a `globalActions..description` fallback. +- `params..{label, helpText, placeholder, options.}` — the per-parameter translations for an action's param dialog. + +Prose only. No schema, factory or resolver changed: the keys were already declared and already accepted, so nothing about what a bundle validates to moves. `packages/spec` publishes `src/**/*.zod.ts`, which is why documentation-only text still ships and still earns a changeset. diff --git a/packages/spec/src/system/translation.zod.ts b/packages/spec/src/system/translation.zod.ts index dc73c8ed3d..0dd61b1d00 100644 --- a/packages/spec/src/system/translation.zod.ts +++ b/packages/spec/src/system/translation.zod.ts @@ -332,8 +332,13 @@ export const ObjectTranslationDataSchema = lazySchema(() => strictObject({ * Action translations keyed by action name (snake_case). * Convention (auto-resolved by `resolveActionLabel`/`resolveActionConfirm`/`resolveActionSuccess`): * objects.._actions..label + * objects.._actions..description * objects.._actions..confirmText * objects.._actions..successMessage + * objects.._actions..params..label + * objects.._actions..params..helpText + * objects.._actions..params..placeholder + * objects.._actions..params..options. * objects.._actions..resultDialog.* */ _actions: z.record(z.string(), actionTranslationSchema('this object action translation')) @@ -664,8 +669,13 @@ const translationDataShape = () => ({ * specific object via `objectName`. Convention (auto-resolved by * `resolveActionLabel`/`resolveActionConfirm`/`resolveActionSuccess`): * globalActions..label + * globalActions..description * globalActions..confirmText * globalActions..successMessage + * globalActions..params..label + * globalActions..params..helpText + * globalActions..params..placeholder + * globalActions..params..options. * globalActions..resultDialog.* */ globalActions: z.record(z.string(), actionTranslationSchema('this global action translation'))