Skip to content

Commit fa2b9fc

Browse files
committed
docs: the metadataForms option aliases are refusals that name options; the resolver table names option labels
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
1 parent 8f1f70f commit fa2b9fc

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎.changeset/36950-metadata-form-option-labels.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ feat(spec): a Studio metadata form's select choices are translatable — `metada
99
Clause-②: yes (widening)
1010
Metadata-protocol: added
1111

12-
- **Translation slot.** A `metadataForms.<type>.fields.<path>` entry accepts `options`, a map from option `value` to its translated name — the shape `objects.<object>.fields.<field>.options` already uses. `choices` and `values` are accepted as its aliases, as on the object-field face.
12+
- **Translation slot.** A `metadataForms.<type>.fields.<path>` entry accepts `options`, a map from option `value` to its translated name — the shape `objects.<object>.fields.<field>.options` already uses. `choices` and `values` are refused there, as on the object-field face, and the refusal names `options` as the key to write.
1313
- **Served forms.** `resolveMetadataFormLabels` (what `/api/v1/meta/types` localizes forms with) now overlays each option's `label` with the translation keyed by its `value`; an option with no translation keeps its own label. Before this, a select on a Studio metadata form (sharing model, ownership, field type, delete behaviour, default period, …) showed English choice names in every locale while the label and help text around it were translated.
1414
- **Extraction.** `os i18n extract` and `pnpm check:i18n` emit the new `options.<value>` keys for every form row that lists `options`.
1515
- **Shipped locales.** The ten translated metadata-forms packs of `@objectstack/platform-objects` name all 185 choices (38 select rows across nine forms). The Default Period choices reuse the wording of the console's period chip.

‎content/docs/protocol/kernel/i18n-standard.mdx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ through the one the renderer reads for that node:
572572

573573
| Node | What the panel reads | Resolver |
574574
|:---|:---|:---|
575-
| a form field, a composite's child | `FormFieldSpec.label` / `helpText` / `placeholder` | `resolveMetadataFormLabels(form, type, bundle, opts)` |
575+
| a form field, a composite's child | `FormFieldSpec.label` / `helpText` / `placeholder`, and each `options[].label` by its `value` | `resolveMetadataFormLabels(form, type, bundle, opts)` |
576576
| a property of a repeater row (a table column header) | the JSON Schema `items.properties[k].title` | `resolveMetadataFormSchemaTitles(schema, type, bundle, opts)` |
577577
| a column of the type's Studio list (`METADATA_LIST_REGISTRY`) | the served `list.columns[].label` | `resolveMetadataListLabels(list, type, bundle, opts)` |
578578

@@ -583,8 +583,8 @@ a column path the form does not declare, with the column's header as the source.
583583
All three run in `GET /api/v1/meta`, which serves every type's `form`, `list`
584584
and `schema` already localised for the request's locale; a client deriving the schema itself
585585
with `z.toJSONSchema` applies the second one to its own copy, over a bundle it
586-
carries itself. Only `label` crosses over to the schema (as `title`); `helpText`
587-
and `placeholder` stay on the form.
586+
carries itself. Only `label` crosses over to the schema (as `title`); `helpText`,
587+
`placeholder` and the option names stay on the form.
588588

589589
Because the server resolves this group, the bundle a console downloads when it
590590
opens — `GET /api/v1/i18n/translations/:locale` — leaves `metadataForms` out:

0 commit comments

Comments
 (0)