Skip to content

Commit 8f1f70f

Browse files
committed
wip: changeset, regenerated translation reference
Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj Co-authored-by: Claude <noreply@anthropic.com>
1 parent 110147e commit 8f1f70f

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/lint': patch
4+
'@objectstack/platform-objects': patch
5+
---
6+
7+
feat(spec): a Studio metadata form's select choices are translatable — `metadataForms.<type>.fields.<path>.options.<value>`
8+
9+
Clause-②: yes (widening)
10+
Metadata-protocol: added
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.
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+
- **Extraction.** `os i18n extract` and `pnpm check:i18n` emit the new `options.<value>` keys for every form row that lists `options`.
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.

‎content/docs/references/system/translation.mdx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ Translation data for a single object
351351
| **label** | `string` | optional | Translated metadata-type display label (overrides registry label) |
352352
| **description** | `string` | optional | Translated metadata-type description |
353353
| **sections** | `Record<string, { label?: string; description?: string }>` | optional | Section translations keyed by section.name |
354-
| **fields** | `Record<string, { label?: string; helpText?: string; placeholder?: string }>` | optional | Field translations keyed by field path (dot-notation for nested fields) |
354+
| **fields** | `Record<string, { label?: string; helpText?: string; placeholder?: string; options?: Record<string, string> }>` | optional | Field translations keyed by field path (dot-notation for nested fields) |
355355

356356
### Nested Shape: `PlatformTranslationData.settingsCommon`
357357

@@ -796,7 +796,7 @@ Translation data for a single object
796796
| **label** | `string` | optional | Translated metadata-type display label (overrides registry label) |
797797
| **description** | `string` | optional | Translated metadata-type description |
798798
| **sections** | `Record<string, { label?: string; description?: string }>` | optional | Section translations keyed by section.name |
799-
| **fields** | `Record<string, { label?: string; helpText?: string; placeholder?: string }>` | optional | Field translations keyed by field path (dot-notation for nested fields) |
799+
| **fields** | `Record<string, { label?: string; helpText?: string; placeholder?: string; options?: Record<string, string> }>` | optional | Field translations keyed by field path (dot-notation for nested fields) |
800800

801801
### Nested Shape: `TranslationData.settingsCommon`
802802

@@ -1019,7 +1019,7 @@ Translation data for a single object
10191019
| **label** | `string` | optional | Translated metadata-type display label (overrides registry label) |
10201020
| **description** | `string` | optional | Translated metadata-type description |
10211021
| **sections** | `Record<string, { label?: string; description?: string }>` | optional | Section translations keyed by section.name |
1022-
| **fields** | `Record<string, { label?: string; helpText?: string; placeholder?: string }>` | optional | Field translations keyed by field path (dot-notation for nested fields) |
1022+
| **fields** | `Record<string, { label?: string; helpText?: string; placeholder?: string; options?: Record<string, string> }>` | optional | Field translations keyed by field path (dot-notation for nested fields) |
10231023

10241024
### Nested Shape: `TranslationItem.settingsCommon`
10251025

0 commit comments

Comments
 (0)