You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit fa2b9fc
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .changeset/36950-metadata-form-option-labels.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ feat(spec): a Studio metadata form's select choices are translatable — `metada
9
9
Clause-②: yes (widening)
10
10
Metadata-protocol: added
11
11
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.
13
13
- **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.
14
14
- **Extraction.** `os i18n extract` and `pnpm check:i18n` emit the new `options.<value>` keys for every form row that lists `options`.
15
15
- **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.
Copy file name to clipboardExpand all lines: content/docs/protocol/kernel/i18n-standard.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -572,7 +572,7 @@ through the one the renderer reads for that node:
572
572
573
573
| Node | What the panel reads | Resolver |
574
574
|:---|:---|:---|
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)` |
576
576
| a property of a repeater row (a table column header) | the JSON Schema `items.properties[k].title` | `resolveMetadataFormSchemaTitles(schema, type, bundle, opts)` |
577
577
| a column of the type's Studio list (`METADATA_LIST_REGISTRY`) | the served `list.columns[].label` | `resolveMetadataListLabels(list, type, bundle, opts)` |
578
578
@@ -583,8 +583,8 @@ a column path the form does not declare, with the column's header as the source.
583
583
All three run in `GET /api/v1/meta`, which serves every type's `form`, `list`
584
584
and `schema` already localised for the request's locale; a client deriving the schema itself
585
585
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.
588
588
589
589
Because the server resolves this group, the bundle a console downloads when it
0 commit comments