Skip to content

Commit d4b2a75

Browse files
feat(spec): a named import mapping's label is translatable at mappings.NAME.label (#34976)
Fixes #34939 Clause-②: yes (widening) Metadata-protocol: added Skills-docs: follow-up owed — #34962 (skills/objectstack-i18n/SKILL.md group list) Claim: issuecomment-6956466284, seat amendment issuecomment-6957676841 (route A: label only, packaged-base guard in, description out). This PR is part (1) of the card. Parts (2) and (3), the import wizard's mapping step and preview, are in the UI-half PR #34961. Both are needed to close the card's three symptoms. ## 维护者速读 - **改了什么:** 翻译包新增 `mappings` 分组,只有一个键 `mappings.NAME.label`。`GET /meta/mapping`(列表与单条)按读者语言返回已命名导入映射的标签。`os i18n extract` / `os i18n check` / `os validate`、Studio 翻译预览与翻译表都认识这个分组。 - **为什么改:** zh-CN 组织里,导入向导按标签列出已保存映射,但标签是映射上的纯字符串,翻译包里没有对应的键,所以每种语言都显示作者原文(如 `Inquiry feed (marketing CSV)`)。 - **风险与回滚:** 纯加宽:新增可选分组与新翻译器,原来能解析的都照常通过。覆盖包里被改过的标签按 ADR-0146 D2 判定,与 book/page 相同。回滚即还原本 PR。`packages/metadata-protocol/src/protocol.ts` 在 main 上恰好处于门面行数上限 11705。按席位裁决(路线 B),把 page/dataset/app/book/mapping 五个 packaged-base 访问器的注释合并为一份共享契约,逐条保留原有陈述,文件现为 11704 行,`check:facade-delegation-only` 通过,未改上限台账。 - **先看:** `packages/spec/src/system/translation.zod.ts`(`mappings` 分组与拒收文案),`packages/spec/src/system/i18n-resolver.ts` 的 `translateMapping`(D2 标签顺序),`packages/rest/src/meta-item-read-gate.ts` 的 `PACKAGED_BASE_ACCESSORS` 新行。 - **两分钟验证:** `pnpm --filter @objectstack/runtime exec vitest run src/domains/meta-list-projection-parity.test.ts`,预期 1365/1365 通过,其中 zh-CN 读 `/meta/mappings` 得到 `线索导入`,en-US 得到 `Lead feed`。 - **需要你做的:** 无,席位落地。 ## What changes - **`@objectstack/spec`** - New optional translation group `mappings` (keyed by mapping `name`, one key `label`) on `TranslationDataSchema`, `PlatformTranslationDataSchema`, `ServedTranslationDataSchema` and `TranslationItemSchema`. - The group is a strict object. `description` and `fieldMapping` are refused with guidance that 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. The group counts in the refusal texts moved from sixteen to seventeen (application) and from seventeen to eighteen (platform). - New `translateMapping`, registered in `METADATA_DOCUMENT_TRANSLATORS`. `TRANSLATABLE_METADATA_TYPES` is derived from that table, so `GET /meta/mapping` (list and item) is localized at the REST boundary with no further wiring. The label follows the ADR-0146 D2 order (`labelCatalogs` / `valueOverridesPackagedBase`), like `translateBook`. - `MappingSchema.label`'s `.describe` names the translation key. - Generated files are regenerated: authorable surface (build-written), api-surface, export-origins, the references docs, the liveness ledger (`mappings` live, with its `label` child) and the strictness-ledger counts. - **`@objectstack/metadata-protocol` / `@objectstack/rest`:** `mapping` joins `PackagedArtifactBaseType`. `getPackagedMappingBase` is on the protocol, forwarding to the facet. A `['mapping', 'getPackagedMappingBase']` row goes in `PACKAGED_BASE_ACCESSORS`. A `.custom` override's label is therefore judged against the shipped base, not read as override-authored. - **`@objectstack/lint`:** - The i18n walk emits `mappings.NAME.label` (source `mapping`). - `validate-translation-references` resolves `mappings.NAME` against the stack's mappings and sibling packages' mappings. An unknown name is `translation-target-unknown` with the nearest name suggested. - The rule explanation names the group. - **`@objectstack/cli`:** `os i18n check` reports gaps as `i18n/missing-mapping`. `--help` names "import mappings". - **`@object-ui/app-shell` / `@object-ui/i18n`:** - The translation preview shows the group as Import Mappings (导入映射). - The Studio translation table walks `mapping` items. - `spec-translations` namespaces the group. - **Showcase:** zh-CN translates `showcase_inquiry_feed`, the one mapping any example authors. - **Docs:** `i18n-standard.mdx` (group list and count), `ui/translations.mdx` (a row, and the resolved-types list), `import-mappings.mdx` (the `label` row names the key). - **Platform checklist** (`docs/qa/platform-checklist/areas/i18n.json`, the file added in L1 round 1): item `i18n.surface-matrix` moves to revision 16. - `acceptance[7].clause` now counts eighteen platform groups, seventeen per-app groups and seventeen scored groups, and names `mappings` in the list. Before, a tester would have scored the showcase's `mappings.showcase_inquiry_feed` as outside the vocabulary. - The `appTranslationDataShape` source line names all seventeen app groups. It used to say fifteen and leave out `hooks`, which was stale before this PR. - The history entry records a count-and-list correction with no change to the clause's meaning. ## Tests - `packages/spec/src/system/i18n-mapping.test.ts` (new): - all four doors accept the group; - the face is closed; - the aliases are refused; - the `description` / `fieldMapping` guidance is shown; - `translateMapping` is registered; - zh-CN reads the translation and en-US gets the same reference back; - the locale ladder and fallback chain apply; - an empty label is not a translation; - the input is not mutated. - `i18n-resolver.test.ts`: a `mapping` row in the ADR-0146 D2 precedence table (now "all nine types"). - REST: the accessor pin and a `mapping` precedence row. objectql: the bare-slot envelope test's label-order types gain `mapping`. - Runtime: the meta list projection parity census carries `mapping` / `mappings`. Over HTTP, zh-CN `/meta/mappings` serves `线索导入` and en-US `/meta/mapping` serves `Lead feed`. The item read is pinned too. - Lint: the walk emits the key from the label only, never from the field mapping. `validate-translation-references` covers four cases: a clean name, an orphan with a suggestion, a report name under `mappings`, and a sibling-declared name. - CLI, `test/i18n-mapping-walk.test.ts` (new): the extract keys, a schema-valid scaffold, and a gap reported as `source: 'mapping'`. - UI: the preview category tests (one entry per group; the coverage denominator goes from 2/16 to 2/17) and the translation table's list-read count (15). - Ablation, two legs, each through `scripts/ablation-replace.mjs` (anchor hit 1/1; restore proven as blob == HEAD and an empty `git diff HEAD`): - dropping `mapping: translateMapping` from the dispatch table fails 9 tests and passes 541 (`i18n-mapping` and the D2 rows); - dropping the `mappings` row from the orphan table fails 2 tests and passes 252. ## Acceptance notes - **The facade line ceiling is paid inside `protocol.ts` (seat ruling, route B).** The per-accessor docblocks of `getPackagedPageBase`, `getPackagedDatasetBase`, `getPackagedAppBase`, `getPackagedBookBase` and the new `getPackagedMappingBase` are folded into one shared contract on `getPackagedPageBase`. That contract names all five accessors. The other four each carry a one-line pointer to it. `protocol.ts` is now 11704 lines against its ceiling of 11705, with the forwarder in. `scripts/facade-delegation-registry.json` is untouched. Where each folded statement now lives: | Statement (before the fold) | Was on | Now in the shared docblock | |:---|:---|:---| | `[#30062]`; the PACKAGED (code-layer) declaration a code package ships, before a `.custom` pair's declared override replaces it (ADR-0146 D2) | page (each of dataset, app, book carried `[#30062]`) | opening sentence, for all five | | the page is the twin of `getPackagedDashboardBase`, answered the same way | page | "the page is the twin of `getPackagedDashboardBase`" | | dataset, app and book are twins of `getPackagedPageBase`, and mapping of `getPackagedBookBase`, answered the same way | dataset, app, book, mapping | "the other four are twins of the page (and of each other), all answered the same way" | | the fact the translator (`@objectstack/spec/system`) compares against as its `packagedBase`; the catalog is the packaged translation of exactly this body, so it may only replace a string the served item still carries unchanged (ruling record 6631250894: pair, then the override's own label, then the base's translation) | page | shared paragraph, for all five | | `translatePage`, `pages.NAME` | page | page bullet | | measured: the `crm_welcome` override labelled `OVpage` was served, and zh-CN got the base's `欢迎页` | page | page bullet | | a page has no extension fold, so the artifact item IS the packaged declaration | page | page bullet (page only) | | `translateDataset`, each string of `datasets.NAME` (label, description, dimension and measure labels) | dataset | dataset bullet | | same reason as the page: a pair's dataset override kept the base's translated label and measure labels over its own | dataset | dataset bullet | | `translateApp`, each string of `apps.NAME` (label, description and navigation labels, a node judged against the base's node of the same `id`) | app | app bullet | | `translateBook`, each string of `books.NAME` (label, description and group labels, a group judged against the base's group of the same `key`) | book | book bullet | | `translateMapping` compares the served label (`mappings.NAME.label`, ADR-0146 D2) | mapping | mapping bullet (with #34939); ADR-0146 D2 is in the opening sentence | | shadow-immune for the dashboard's reason: served from its row, never as the artifact, so the body is the base's own | page | closing paragraph, for all five | | returns `undefined` for an item no code package ships, an unknown or empty name, or a registry double without the lookup, which the translator reads as the catalog applying unchanged ("the same uncertainties" for the other four) | page, with the others pointing to it | closing paragraph, for all five | - `description` stays out (seat ruling): `MappingSchema` declares none. - **Other spelled group counts and lists.** At `f23f65d8c8` the tree was grepped over `docs/qa`, `content/docs`, `scripts`, `packages`, `ui`, `examples` and `skills`. Every spelled translation-group count or list either is correct (`i18n-standard.mdx`, `translation.zod.ts`) or was fixed above (`i18n.json`). Two places were left alone: - `scripts/check-i18n-walk-parity.mjs`'s `RECORDED_*` arrays are a declared sample, not a source of truth; - `skills/objectstack-i18n/SKILL.md` stays with #34962. - The changeset's Clause-② line now names `ObjectStackProtocolImplementation.getPackagedMappingBase` (L1 N1). - `skills/**` is untouched. The group list in `skills/objectstack-i18n/SKILL.md` is owed on #34962. ## Verification The PR head is `f23f65d8c8`. It is a merge of `origin/main` (`fb5c42d10c`; none of the 24 files it brings overlaps this PR's source, and `protocol.ts` stays at 11704 lines) on top of `32942ddd5c`, which carries the checklist correction and the changeset wording. <details><summary>At f23f65d, L1 round 1</summary> - `pnpm check:platform-checklist`: exit 0 (16 areas, 433 items). - `node scripts/pm/check-governed-merges.mjs --pr 34976`: NOT governed (0 of 42 paths hit the register), 704 changed lines (+615 / -89), under the 3000 threshold. - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` re-derived the same 139 commands, and all ran again at this head. - Reconciliation, `--ran` with exit codes: 139 derived, 138 run, 1 NOT-MEASURED, 0 UNRUN. Every run family exited 0, including `check:facade-delegation-only`, `check:i18n-coverage` and `check:platform-checklist`. NOT MEASURED: `check:dual-build-cjs-loads`, exit 3 (whole-workspace `dist/` prerequisite). CI runs it. - After the merge, under the verify lock: the two preview pins plus `packages/i18n/`, Test Files 104 passed (104), Tests 1959 passed, 13 skipped. </details> The previous round's head, `ab48a19f39`, adds the docblock fold on top of `9d26d5a770`. The fold changes comments only, in `packages/metadata-protocol/src/protocol.ts`. <details><summary>At ab48a19, after the fold</summary> - `pnpm check:facade-delegation-only`: exit 0. `protocol.ts` is 11704 lines against a ceiling of 11705, with 322 delegations and 1 named exception. - `pnpm --filter @objectstack/metadata-protocol typecheck`: exit 0, after building its dependency closure. `pnpm --filter @objectstack/metadata-protocol build`: exit 0. - The two suites that call the packaged-base accessors, under the verify lock: - rest `meta-dashboard-view-i18n-explicit-override`: Tests 114 passed (114); - objectql `protocol-custom-override-bare-slot-envelope`: Tests 114 passed (114). - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` re-derived the same 139 commands, and all ran again at this head. - Reconciliation, `--ran` with exit codes: 139 derived, 138 run, 1 NOT-MEASURED, 0 UNRUN. Every run family exited 0, including `check:i18n`, `check:i18n-coverage`, `check:i18n-walk-parity`, `check:skill-examples` and `check:doc-formula-expressions`. - NOT MEASURED: `pnpm check:dual-build-cjs-loads`, exit 3 (PREREQUISITE NOT MET). It reads every package's `dist/`, and this checkout did not build the whole workspace. CI runs it. </details> <details><summary>At 9d26d5a, before the fold (unchanged by it)</summary> - `@objectstack/spec`, the `i18n-mapping`, `i18n-resolver` and translation suites (4 files): Tests 792 passed. - At `e2ac16438e`: - lint `i18n-walk`, `validate-translation-references` and `rule-explanations`: Tests 274 passed (274); - runtime `meta-list-projection-parity`: Tests 1365 passed (1365). - CLI unit tier at `0663ffad1f`: Test Files 4 passed (4), Tests 27 passed (27). The integration tier is left to CI. - UI: - app-shell previews plus `translationTable.test.ts`: Tests 1809 passed (1809); - `packages/i18n/`: Tests 1896 passed, 13 skipped; - the two edited preview pins at `3a7c72e8a0`: Tests 63 passed (63). - Typecheck, exit 0 for each: `@objectstack/lint`, `@objectstack/cli`, `@objectstack/rest`, and `@object-ui/i18n` / `@object-ui/app-shell` `type-check`. - Every other CI family is left to this PR's check runs. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01WGufzgwLiKcfujYUug7sPs)_ <!-- signed: repo:objectstack#3 · os-support-ai · session_01WGufzgwLiKcfujYUug7sPs --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 743308b commit d4b2a75

42 files changed

Lines changed: 615 additions & 89 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/metadata-protocol': minor
4+
'@objectstack/rest': minor
5+
'@objectstack/lint': minor
6+
'@objectstack/cli': minor
7+
'@object-ui/app-shell': minor
8+
'@object-ui/i18n': minor
9+
---
10+
11+
feat(spec): a named import mapping's label is translatable at `mappings.NAME.label`
12+
13+
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
14+
Metadata-protocol: added
15+
Skills-docs: follow-up owed — #34962 (skills/objectstack-i18n/SKILL.md group list)
16+
17+
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:
18+
19+
```ts
20+
'zh-CN': { mappings: { crm_lead_feed: { label: '线索导入' } } }
21+
```
22+
23+
- `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.
24+
- 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.
25+
- `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.
26+
- Studio's translation preview shows the group as **Import Mappings** (导入映射), and the Studio translation table walks it.

‎content/docs/data-modeling/import-mappings.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ mapping under its own name.
116116
| Key | Type | What it does |
117117
|:---|:---|:---|
118118
| `name` | `string` (snake_case) | The id `mappingName` resolves. Missing artifact → `404 MAPPING_NOT_FOUND`. |
119-
| `label` | `string` | Display text in a saved-mapping picker. Falls back to `name`. |
119+
| `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). |
120120
| `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). |
121121
| `targetObject` | `string` | The object this mapping is for. Must equal the object in the URL. |
122122
| `fieldMapping` | `ImportFieldMapping[]` | The projection itself — one entry per target field. |

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ Three rules the shape enforces, all of them closed since #4001:
493493
- **The top level is the declared group set and nothing else** — `objects`,
494494
`picklists`, `apps`, `messages`, `globalActions`, `dashboards`, `datasets`,
495495
`reports`, `pages`, `flows`, `hooks`, `positions`, `permissions`, `books`,
496-
`metadataForms`, `settingsCommon`. A group invented beside them
496+
`mappings`, `metadataForms`, `settingsCommon`. A group invented beside them
497497
(`"account"`, `"fields"`, `"list"`, `"industries"`) is rejected **by name**
498498
at both authoring doors, with the group to use instead named in the
499499
rejection.
@@ -582,7 +582,7 @@ what the overlay writes back as the node's `title`.
582582
The contract is `t(key, locale, params?)` — the target locale is always passed
583583
explicitly, and the key itself is returned when no translation is found (there
584584
is no `defaultValue` option). The key is a **dot path into `TranslationData`**,
585-
so it starts at one of the sixteen declared groups.
585+
so it starts at one of the seventeen declared groups.
586586

587587
```typescript
588588
const i18n = kernel.getService('i18n');

‎content/docs/references/api/protocol.mdx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1882,6 +1882,7 @@ The published metadata item body, opaque by ruling (1C). Shape is the item's own
18821882
| **positions** | `Record<string, { label?: string; description?: string }>` | optional | Position translations keyed by position name |
18831883
| **permissions** | `Record<string, { label?: string; description?: string }>` | optional | Permission-set translations keyed by permission-set name |
18841884
| **books** | `Record<string, { label?: string; description?: string; groups?: Record<string, object> }>` | optional | Doc-book translations keyed by book name |
1885+
| **mappings** | `Record<string, { label?: string }>` | optional | Import-mapping translations keyed by mapping name |
18851886
| **settingsCommon** | `{ sourceLabels?: object }` | optional | Cross-namespace Settings UI strings |
18861887
| **settings** | `Record<string, { title?: string; description?: string; groups?: Record<string, object>; keys?: Record<string, object>; … }>` | optional | Settings manifest translations keyed by namespace |
18871888

‎content/docs/references/data/mapping.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const result = ImportFieldMappingSchema.parse(data);
4343
| Property | Type | Required | Description |
4444
| :--- | :--- | :--- | :--- |
4545
| **name** | `string` | ✅ | Mapping unique name (lowercase snake_case) |
46-
| **label** | `string` | optional | |
46+
| **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 |
4747
| **sourceFormat** | `Enum<'csv' \| 'json' \| 'xml' \| 'sql'>` | optional (default: `"csv"`) | |
4848
| **targetObject** | `string` | ✅ | Target Object Name |
4949
| **fieldMapping** | `{ source: string \| string[]; target: string \| string[]; transform?: Enum<'none' \| 'constant' \| 'lookup' \| 'split' \| 'join' \| 'javascript' \| 'map'>; params?: object }[]` | ✅ | |

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ Platform translation data — the per-app groups plus the platform-only `setting
195195
| **positions** | `Record<string, { label?: string; description?: string }>` | optional | Position translations keyed by position name |
196196
| **permissions** | `Record<string, { label?: string; description?: string }>` | optional | Permission-set translations keyed by permission-set name |
197197
| **books** | `Record<string, { label?: string; description?: string; groups?: Record<string, object> }>` | optional | Doc-book translations keyed by book name |
198+
| **mappings** | `Record<string, { label?: string }>` | optional | Import-mapping translations keyed by mapping name |
198199
| **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 |
199200
| **settingsCommon** | `{ sourceLabels?: object }` | optional | Cross-namespace Settings UI strings |
200201
| **settings** | `Record<string, { title?: string; description?: string; groups?: Record<string, object>; keys?: Record<string, object>; … }>` | optional | Settings manifest translations keyed by namespace |
@@ -326,6 +327,12 @@ Translation data for a single object
326327
| **description** | `string` | optional | Translated book description — overlays the book's own `description` |
327328
| **groups** | `Record<string, { label: string }>` | optional | Group (section) translations keyed by the group `key` |
328329

330+
### Nested Shape: `PlatformTranslationData.mappings[string]`
331+
332+
| Property | Type | Required | Description |
333+
| :--- | :--- | :--- | :--- |
334+
| **label** | `string` | optional | Translated import mapping label — overlays the mapping's own `label` |
335+
329336
### Nested Shape: `PlatformTranslationData.metadataForms[string]`
330337

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

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

518+
### Nested Shape: `ServedTranslationData.mappings[string]`
519+
520+
| Property | Type | Required | Description |
521+
| :--- | :--- | :--- | :--- |
522+
| **label** | `string` | optional | Translated import mapping label — overlays the mapping's own `label` |
523+
510524
### Nested Shape: `ServedTranslationData.settingsCommon`
511525

512526
| Property | Type | Required | Description |
@@ -621,6 +635,7 @@ Per-app translation data for objects, apps, and UI messages
621635
| **positions** | `Record<string, { label?: string; description?: string }>` | optional | Position translations keyed by position name |
622636
| **permissions** | `Record<string, { label?: string; description?: string }>` | optional | Permission-set translations keyed by permission-set name |
623637
| **books** | `Record<string, { label?: string; description?: string; groups?: Record<string, object> }>` | optional | Doc-book translations keyed by book name |
638+
| **mappings** | `Record<string, { label?: string }>` | optional | Import-mapping translations keyed by mapping name |
624639
| **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 |
625640
| **settingsCommon** | `{ sourceLabels?: object }` | optional | Cross-namespace Settings UI strings |
626641

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

769+
### Nested Shape: `TranslationData.mappings[string]`
770+
771+
| Property | Type | Required | Description |
772+
| :--- | :--- | :--- | :--- |
773+
| **label** | `string` | optional | Translated import mapping label — overlays the mapping's own `label` |
774+
754775
### Nested Shape: `TranslationData.metadataForms[string]`
755776

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

989+
### Nested Shape: `TranslationItem.mappings[string]`
990+
991+
| Property | Type | Required | Description |
992+
| :--- | :--- | :--- | :--- |
993+
| **label** | `string` | optional | Translated import mapping label — overlays the mapping's own `label` |
994+
967995
### Nested Shape: `TranslationItem.metadataForms[string]`
968996

969997
| Property | Type | Required | Description |

‎content/docs/ui/translations.mdx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,13 @@ export default defineStack({
9898
| 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 |
9999
| 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` |
100100
| 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 |
101+
| 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` |
101102
| Global actions, messages | `globalActions`, `messages` |
102103
| 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 |
103104
| 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 |
104105

105106
The metadata types resolved per request are **object, view, action, app,
106-
dashboard, dataset, report, page, picklist, position, permission and book** — a field's labels are translated as part of
107+
dashboard, dataset, report, page, picklist, position, permission, book and mapping** — a field's labels are translated as part of
107108
its object document, and so are the labels of any actions the object declares
108109
inline
109110
(#3370). Before that, an object document went out with its authored action

‎docs/audits/2026-07-unknown-key-strictness-ledger.counts/system.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ hand-patch a number here** — fix the code or the verdict and regenerate.
1919

2020
| Dir | Sites |
2121
|---|---|
22-
| `system/` | 405 |
22+
| `system/` | 406 |

0 commit comments

Comments
 (0)