Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changeset/translation-actions-convention-docblock-keys.md
Original file line number Diff line number Diff line change
@@ -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.<object>._actions.<action>.description` with a `globalActions.<action>.description` fallback.
- `params.<param_name>.{label, helpText, placeholder, options.<value>}` — 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.
10 changes: 10 additions & 0 deletions packages/spec/src/system/translation.zod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.<object>._actions.<action_name>.label
* objects.<object>._actions.<action_name>.description
* objects.<object>._actions.<action_name>.confirmText
* objects.<object>._actions.<action_name>.successMessage
* objects.<object>._actions.<action_name>.params.<param_name>.label
* objects.<object>._actions.<action_name>.params.<param_name>.helpText
* objects.<object>._actions.<action_name>.params.<param_name>.placeholder
* objects.<object>._actions.<action_name>.params.<param_name>.options.<value>
* objects.<object>._actions.<action_name>.resultDialog.*
*/
_actions: z.record(z.string(), actionTranslationSchema('this object action translation'))
Expand Down Expand Up @@ -664,8 +669,13 @@ const translationDataShape = () => ({
* specific object via `objectName`. Convention (auto-resolved by
* `resolveActionLabel`/`resolveActionConfirm`/`resolveActionSuccess`):
* globalActions.<action_name>.label
* globalActions.<action_name>.description
* globalActions.<action_name>.confirmText
* globalActions.<action_name>.successMessage
* globalActions.<action_name>.params.<param_name>.label
* globalActions.<action_name>.params.<param_name>.helpText
* globalActions.<action_name>.params.<param_name>.placeholder
* globalActions.<action_name>.params.<param_name>.options.<value>
* globalActions.<action_name>.resultDialog.*
*/
globalActions: z.record(z.string(), actionTranslationSchema('this global action translation'))
Expand Down
Loading