Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
b716d62
feat(spec): mappings translation group and translateMapping
claude Nov 17, 2026
16753ac
test(spec): mappings group doors, translateMapping and the ADR-0146 D…
claude Nov 17, 2026
b9d00c0
chore(spec): seed the mappings translation group live in the liveness…
claude Nov 17, 2026
d3e28f4
chore(spec): regenerate api-surface, export-origins, references docs …
claude Nov 17, 2026
5224fd5
feat(metadata-protocol,rest): an import mapping's packaged base feeds…
claude Nov 17, 2026
68f0cac
feat(lint,runtime): the i18n walk keys mappings.MAPPING.label; the me…
claude Nov 17, 2026
387070d
feat(lint,cli): mappings.MAPPING resolves against the stack's mapping…
claude Nov 17, 2026
12dbcdc
feat(app-shell,i18n): the translation preview and Studio translation …
claude Nov 17, 2026
e2ac164
docs(i18n): the mappings group in the i18n standard, the translations…
claude Nov 17, 2026
0663ffa
test(cli): an unlabelled mapping scaffolds no key
claude Nov 17, 2026
81f6322
docs(changeset): state the ADR-0146 D2 order for an overridden mappin…
claude Nov 17, 2026
24cab23
docs(metadata-protocol): a shorter contract for getPackagedMappingBase
claude Nov 17, 2026
3a7c72e
test(app-shell): the preview category pins pay the validator's dynami…
claude Nov 17, 2026
9d26d5a
Merge origin/main into claude/issue-34939-mapping-translation-group
claude Nov 17, 2026
ab48a19
docs(metadata-protocol): one shared contract for the page, dataset, a…
claude Nov 17, 2026
32942dd
docs(qa): the i18n surface matrix names the mappings group in its ser…
claude Nov 17, 2026
f23f65d
Merge origin/main into claude/issue-34939-mapping-translation-group
claude Nov 17, 2026
bceea13
Merge remote-tracking branch 'origin/main' into claude/issue-34939-ma…
claude Nov 17, 2026
2842767
chore(spec): regenerate export-origins, api-surface and the reference…
claude Nov 17, 2026
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
26 changes: 26 additions & 0 deletions .changeset/34939-translation-mappings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
'@objectstack/spec': minor
'@objectstack/metadata-protocol': minor
'@objectstack/rest': minor
'@objectstack/lint': minor
'@objectstack/cli': minor
'@object-ui/app-shell': minor
'@object-ui/i18n': minor
---

feat(spec): a named import mapping's label is translatable at `mappings.NAME.label`

Clause-②: yes (widening) — a new optional translation group `mappings` (one key per mapping, `label`) on `TranslationDataSchema`, `PlatformTranslationDataSchema`, `ServedTranslationDataSchema` and `TranslationItemSchema`, a new `translateMapping` export from `@objectstack/spec/system` registered for the `mapping` type, and a new `ObjectStackProtocolImplementation.getPackagedMappingBase`; nothing that parsed before is refused
Metadata-protocol: added
Skills-docs: follow-up owed — #34962 (skills/objectstack-i18n/SKILL.md group list)

An import mapping's `label` is the name the import wizard offers it by, and until now it showed the authored text in every locale: the bundle had no key for it. A bundle now translates it:

```ts
'zh-CN': { mappings: { crm_lead_feed: { label: '线索导入' } } }
```

- `GET /meta/mapping` (list and item) serves the label in the reader's locale. A shipped mapping overridden through its `.custom` pair follows the ADR-0146 D2 order every other translated label follows: a label the override changed keeps its own text unless the pair translates it, and a label it left alone takes the pair's translation, then the package's. The packaged base is now available for `mapping` (`getPackagedMappingBase`), so the override's label is judged against it.
- Only `label` has a key. A mapping declares no `description`, and its `fieldMapping` holds column and field names rather than copy — the refusal for either names where to translate instead (a target field's label is `objects.OBJECT.fields.FIELD.label`). The singular `mapping` and the label aliases `name` / `title` are refused with the declared spelling named.
- `os i18n extract` scaffolds the key, `os i18n check` reports a gap as `i18n/missing-mapping`, and `os validate` reports a key naming no mapping of the stack as `translation-target-unknown`, with the nearest name suggested.
- Studio's translation preview shows the group as **Import Mappings** (导入映射), and the Studio translation table walks it.
2 changes: 1 addition & 1 deletion content/docs/data-modeling/import-mappings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ mapping under its own name.
| Key | Type | What it does |
|:---|:---|:---|
| `name` | `string` (snake_case) | The id `mappingName` resolves. Missing artifact → `404 MAPPING_NOT_FOUND`. |
| `label` | `string` | Display text in a saved-mapping picker. Falls back to `name`. |
| `label` | `string` | Display text in a saved-mapping picker (the import wizard). Falls back to `name`. Translated per locale at `mappings.<name>.label` in the app's translation bundle — see [Translations](/docs/ui/translations). |
| `sourceFormat` | `'csv' \| 'json' \| 'xml' \| 'sql'` | Declared payload format, checked against what the request actually sent. Defaults to `csv`. See [the format gate](#rejections-before-any-row-is-read). |
| `targetObject` | `string` | The object this mapping is for. Must equal the object in the URL. |
| `fieldMapping` | `ImportFieldMapping[]` | The projection itself — one entry per target field. |
Expand Down
4 changes: 2 additions & 2 deletions content/docs/protocol/kernel/i18n-standard.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ Three rules the shape enforces, all of them closed since #4001:
- **The top level is the declared group set and nothing else** — `objects`,
`picklists`, `apps`, `messages`, `globalActions`, `dashboards`, `datasets`,
`reports`, `pages`, `flows`, `hooks`, `positions`, `permissions`, `books`,
`metadataForms`, `settingsCommon`. A group invented beside them
`mappings`, `metadataForms`, `settingsCommon`. A group invented beside them
(`"account"`, `"fields"`, `"list"`, `"industries"`) is rejected **by name**
at both authoring doors, with the group to use instead named in the
rejection.
Expand Down Expand Up @@ -582,7 +582,7 @@ what the overlay writes back as the node's `title`.
The contract is `t(key, locale, params?)` — the target locale is always passed
explicitly, and the key itself is returned when no translation is found (there
is no `defaultValue` option). The key is a **dot path into `TranslationData`**,
so it starts at one of the sixteen declared groups.
so it starts at one of the seventeen declared groups.

```typescript
const i18n = kernel.getService('i18n');
Expand Down
1 change: 1 addition & 0 deletions content/docs/references/api/protocol.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1882,6 +1882,7 @@ The published metadata item body, opaque by ruling (1C). Shape is the item's own
| **positions** | `Record<string, { label?: string; description?: string }>` | optional | Position translations keyed by position name |
| **permissions** | `Record<string, { label?: string; description?: string }>` | optional | Permission-set translations keyed by permission-set name |
| **books** | `Record<string, { label?: string; description?: string; groups?: Record<string, object> }>` | optional | Doc-book translations keyed by book name |
| **mappings** | `Record<string, { label?: string }>` | optional | Import-mapping translations keyed by mapping name |
| **settingsCommon** | `{ sourceLabels?: object }` | optional | Cross-namespace Settings UI strings |
| **settings** | `Record<string, { title?: string; description?: string; groups?: Record<string, object>; keys?: Record<string, object>; … }>` | optional | Settings manifest translations keyed by namespace |

Expand Down
2 changes: 1 addition & 1 deletion content/docs/references/data/mapping.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const result = ImportFieldMappingSchema.parse(data);
| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **name** | `string` | ✅ | Mapping unique name (lowercase snake_case) |
| **label** | `string` | optional | |
| **label** | `string` | optional | Display label, shown where the mapping is offered by name (the import wizard); translated per locale at `mappings.<name>.label` in the translation bundle |
| **sourceFormat** | `Enum<'csv' \| 'json' \| 'xml' \| 'sql'>` | optional (default: `"csv"`) | |
| **targetObject** | `string` | ✅ | Target Object Name |
| **fieldMapping** | `{ source: string \| string[]; target: string \| string[]; transform?: Enum<'none' \| 'constant' \| 'lookup' \| 'split' \| 'join' \| 'javascript' \| 'map'>; params?: object }[]` | ✅ | |
Expand Down
28 changes: 28 additions & 0 deletions content/docs/references/system/translation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ Platform translation data — the per-app groups plus the platform-only `setting
| **positions** | `Record<string, { label?: string; description?: string }>` | optional | Position translations keyed by position name |
| **permissions** | `Record<string, { label?: string; description?: string }>` | optional | Permission-set translations keyed by permission-set name |
| **books** | `Record<string, { label?: string; description?: string; groups?: Record<string, object> }>` | optional | Doc-book translations keyed by book name |
| **mappings** | `Record<string, { label?: string }>` | optional | Import-mapping translations keyed by mapping name |
| **metadataForms** | `Record<string, { label?: string; description?: string; sections?: Record<string, object>; fields?: Record<string, object> }>` | optional | Translations for metadata-type configuration forms keyed by metadata type |
| **settingsCommon** | `{ sourceLabels?: object }` | optional | Cross-namespace Settings UI strings |
| **settings** | `Record<string, { title?: string; description?: string; groups?: Record<string, object>; keys?: Record<string, object>; … }>` | optional | Settings manifest translations keyed by namespace |
Expand Down Expand Up @@ -326,6 +327,12 @@ Translation data for a single object
| **description** | `string` | optional | Translated book description — overlays the book's own `description` |
| **groups** | `Record<string, { label: string }>` | optional | Group (section) translations keyed by the group `key` |

### Nested Shape: `PlatformTranslationData.mappings[string]`

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **label** | `string` | optional | Translated import mapping label — overlays the mapping's own `label` |

### Nested Shape: `PlatformTranslationData.metadataForms[string]`

| Property | Type | Required | Description |
Expand Down Expand Up @@ -377,6 +384,7 @@ Served translation data — the platform groups the browser reads, without the s
| **positions** | `Record<string, { label?: string; description?: string }>` | optional | Position translations keyed by position name |
| **permissions** | `Record<string, { label?: string; description?: string }>` | optional | Permission-set translations keyed by permission-set name |
| **books** | `Record<string, { label?: string; description?: string; groups?: Record<string, object> }>` | optional | Doc-book translations keyed by book name |
| **mappings** | `Record<string, { label?: string }>` | optional | Import-mapping translations keyed by mapping name |
| **settingsCommon** | `{ sourceLabels?: object }` | optional | Cross-namespace Settings UI strings |
| **settings** | `Record<string, { title?: string; description?: string; groups?: Record<string, object>; keys?: Record<string, object>; … }>` | optional | Settings manifest translations keyed by namespace |

Expand Down Expand Up @@ -507,6 +515,12 @@ Translation data for a single object
| **description** | `string` | optional | Translated book description — overlays the book's own `description` |
| **groups** | `Record<string, { label: string }>` | optional | Group (section) translations keyed by the group `key` |

### Nested Shape: `ServedTranslationData.mappings[string]`

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **label** | `string` | optional | Translated import mapping label — overlays the mapping's own `label` |

### Nested Shape: `ServedTranslationData.settingsCommon`

| Property | Type | Required | Description |
Expand Down Expand Up @@ -621,6 +635,7 @@ Per-app translation data for objects, apps, and UI messages
| **positions** | `Record<string, { label?: string; description?: string }>` | optional | Position translations keyed by position name |
| **permissions** | `Record<string, { label?: string; description?: string }>` | optional | Permission-set translations keyed by permission-set name |
| **books** | `Record<string, { label?: string; description?: string; groups?: Record<string, object> }>` | optional | Doc-book translations keyed by book name |
| **mappings** | `Record<string, { label?: string }>` | optional | Import-mapping translations keyed by mapping name |
| **metadataForms** | `Record<string, { label?: string; description?: string; sections?: Record<string, object>; fields?: Record<string, object> }>` | optional | Translations for metadata-type configuration forms keyed by metadata type |
| **settingsCommon** | `{ sourceLabels?: object }` | optional | Cross-namespace Settings UI strings |

Expand Down Expand Up @@ -751,6 +766,12 @@ Translation data for a single object
| **description** | `string` | optional | Translated book description — overlays the book's own `description` |
| **groups** | `Record<string, { label: string }>` | optional | Group (section) translations keyed by the group `key` |

### Nested Shape: `TranslationData.mappings[string]`

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **label** | `string` | optional | Translated import mapping label — overlays the mapping's own `label` |

### Nested Shape: `TranslationData.metadataForms[string]`

| Property | Type | Required | Description |
Expand Down Expand Up @@ -823,6 +844,7 @@ One locale of translations — the `translation` metadata type
| **positions** | `Record<string, { label?: string; description?: string }>` | optional | Position translations keyed by position name |
| **permissions** | `Record<string, { label?: string; description?: string }>` | optional | Permission-set translations keyed by permission-set name |
| **books** | `Record<string, { label?: string; description?: string; groups?: Record<string, object> }>` | optional | Doc-book translations keyed by book name |
| **mappings** | `Record<string, { label?: string }>` | optional | Import-mapping translations keyed by mapping name |
| **metadataForms** | `Record<string, { label?: string; description?: string; sections?: Record<string, object>; fields?: Record<string, object> }>` | optional | Translations for metadata-type configuration forms keyed by metadata type |
| **settingsCommon** | `{ sourceLabels?: object }` | optional | Cross-namespace Settings UI strings |
| **locale** | `string` | ✅ | BCP-47 locale this item translates (e.g. "zh-CN") |
Expand Down Expand Up @@ -964,6 +986,12 @@ Translation data for a single object
| **description** | `string` | optional | Translated book description — overlays the book's own `description` |
| **groups** | `Record<string, { label: string }>` | optional | Group (section) translations keyed by the group `key` |

### Nested Shape: `TranslationItem.mappings[string]`

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **label** | `string` | optional | Translated import mapping label — overlays the mapping's own `label` |

### Nested Shape: `TranslationItem.metadataForms[string]`

| Property | Type | Required | Description |
Expand Down
3 changes: 2 additions & 1 deletion content/docs/ui/translations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,13 @@ export default defineStack({
| Position label / description | `positions.<name>.label` / `description` — keyed by the position's `name`; overlaid on every served position, which is the list the console's position picker draws |
| Permission-set label / description | `permissions.<name>.label` / `description` — the group is spelled as the stack spells the collection (`permissions[]`), keyed by the set's `name` |
| Doc book title, description and section titles | `books.<name>.label` / `description` / `groups.<key>.label` — keyed by the book's `name` and each group's `key`; overlaid on every served book and on the book tree, which is what the docs sidebar draws. A doc's own title and body localize through `doc.translations` instead |
| Import mapping label | `mappings.<name>.label` — keyed by the mapping's `name`; overlaid on every served mapping, which is the list the import wizard offers by name. A mapping's `fieldMapping` holds column and field names, not copy: a target field's label is translated under `objects.<object>.fields.<field>.label` |
| Global actions, messages | `globalActions`, `messages` |
| Settings UI shell copy (the source badge on a settings row) | `settingsCommon.sourceLabels.<layer>` — the per-namespace settings copy under `settings` is **platform-only**: an app bundle carrying it is refused by name, and the platform's own strings are translated in `@objectstack/service-settings`'s bundle |
| A label written as an inline locale map (`label: { en: 'Members', 'zh-CN': '成员' }`) | Nowhere — it is written on the metadata and resolved at render time; see **Current boundaries** below |

The metadata types resolved per request are **object, view, action, app,
dashboard, dataset, report, page, picklist, position, permission and book** — a field's labels are translated as part of
dashboard, dataset, report, page, picklist, position, permission, book and mapping** — a field's labels are translated as part of
its object document, and so are the labels of any actions the object declares
inline
(#3370). Before that, an object document went out with its authored action
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ hand-patch a number here** — fix the code or the verdict and regenerate.

| Dir | Sites |
|---|---|
| `system/` | 405 |
| `system/` | 406 |
Loading
Loading