Skip to content

Commit 6a8399c

Browse files
committed
docs(i18n): column header keys; changeset
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfRcWkapqoXk7QZVob
1 parent f08bb34 commit 6a8399c

4 files changed

Lines changed: 40 additions & 11 deletions

File tree

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/lint': patch
4+
'@objectstack/platform-objects': patch
5+
'@object-ui/i18n': patch
6+
---
7+
8+
feat(spec, lint, i18n): an action answer table's column headers have a translation bundle key
9+
10+
Clause-②: yes (widening) — `ActionResultDialogTranslationSchema` and the action `preflight` translation node accept a new optional `columns` map, `columns.<field path>.<column path>` (both keys literal, dots included), beside `fields`; every bundle that parsed before parses unchanged and reads the same.
11+
Metadata-protocol: added
12+
Skills-docs: follow-up owed — skills/objectstack-i18n/SKILL.md
13+
14+
A `format: 'table'` field in an action's `resultDialog.fields` or `preflight.fields` declares `columns: [{ path, label }]`, and each column's `label` is translatable, but no bundle key carried it, so a table's headers stayed in the authored language in every locale. The key is `objects.<object>._actions.<action>.resultDialog.columns.<field path>.<column path>` (and `….preflight.columns.…`; `globalActions.<action>.…` for an object-less action):
15+
16+
```ts
17+
resultDialog: {
18+
fields: { rows: '逐行结果' },
19+
columns: { rows: { email: '邮箱', 'error.message': '未添加的原因' } },
20+
}
21+
```
22+
23+
- `os i18n extract` lists one key per labelled column, `os validate` refuses a column key that names no declared table field or column (`translation-target-unknown`), and `resolveActionResultDialog` / `resolveActionPreflight` (so `translateAction` and the served metadata) and the console's `useObjectLabel` overlay the translated header; a column with no key keeps its authored label.
24+
- The platform bundles carry the nine column headers of `sys_user.import_sso_users`'s result table in every shipped locale.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,7 @@ beneath an action entry are judged the same way under either.
11551155
| `{action}.params.{param}.options.{value}` | an option's stored **`value`** in that param's inline `options` — a warning, as on a field. A param that references a `field` and declares no inline `options` takes the field's list when the dialog renders, so its option keys are not judged |
11561156
| `{action}.outcomeMessages.{outcome}` | an outcome the action's own `outcomeMessages` declares |
11571157
| `{action}.resultDialog.fields.{path}` | the literal `path` of a field the action's `resultDialog.fields[]` declares — dots included, so `client.secret` is one key |
1158+
| `{action}.resultDialog.columns.{path}.{column}` / `{action}.preflight.columns.{path}.{column}` | a column header of a table: `{path}` the literal `path` of a `format: 'table'` field in that block's `fields[]`, `{column}` the literal `path` of one of its `columns[]` — dots included at both levels, so `columns.rows["error.message"]` is two keys deep, not three |
11581159
| `{action}.resultDialog.title` / `.description` / `.acknowledge` | an action that declares a `resultDialog`, whether or not the dialog sets that text itself — for an action that declares none, nothing reads the dialog's copy |
11591160
| `apps.{app}` | an app declared, or one a `navigationContributions` entry anywhere in the artifact contributes into — including an app owned outside the artifact; under an app that is only contributed into, `apps.{app}.label` may be left out (the owning package's label survives the merge) |
11601161
| `apps.{app}.navigation.{id}` | a navigation item `id` the app declares (nested `children` and `areas[]` included) or one contributed into it; under an app that is only contributed into, the contributed ids alone |

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Translations for an action result dialog
3434
| **description** | `string` | optional | Translated result dialog description |
3535
| **acknowledge** | `string` | optional | Translated acknowledge button label |
3636
| **fields** | `Record<string, string>` | optional | Result field labels keyed by the literal field path declared in the action metadata (keys may contain dots) |
37+
| **columns** | `Record<string, Record<string, string>>` | optional | Table column header labels: keyed by the literal path of a `format: 'table'` field, then by the literal path of one of its `columns[]` (keys may contain dots) |
3738

3839

3940
---
@@ -136,8 +137,8 @@ Translation data for a single field
136137
| **cancelText** | `string` | optional | Translated label of the dismiss button on the action's confirm or param dialog (the action must declare `confirmText` or `params`) |
137138
| **outcomeMessages** | `Record<string, string>` | optional | Translated success copy per handler outcome, keyed by the snake_case outcome name the action's `outcomeMessages` declares |
138139
| **params** | `Record<string, { label?: string; helpText?: string; placeholder?: string; options?: Record<string, string> }>` | optional | Action parameter translations keyed by parameter name |
139-
| **resultDialog** | `{ title?: string; description?: string; acknowledge?: string; fields?: Record<string, string> }` | optional | Translations for the action result dialog |
140-
| **preflight** | `{ fields?: Record<string, string> }` | optional | Translations for the action preflight panel |
140+
| **resultDialog** | `{ title?: string; description?: string; acknowledge?: string; fields?: Record<string, string>; … }` | optional | Translations for the action result dialog |
141+
| **preflight** | `{ fields?: Record<string, string>; columns?: Record<string, Record<string, string>> }` | optional | Translations for the action preflight panel |
141142

142143
### Nested Shape: `ObjectTranslationData._sections[string]`
143144

@@ -241,8 +242,8 @@ Translation data for a single object
241242
| **cancelText** | `string` | optional | Translated label of the dismiss button on the action's confirm or param dialog (the action must declare `confirmText` or `params`) |
242243
| **outcomeMessages** | `Record<string, string>` | optional | Translated success copy per handler outcome, keyed by the snake_case outcome name the action's `outcomeMessages` declares |
243244
| **params** | `Record<string, { label?: string; helpText?: string; placeholder?: string; options?: Record<string, string> }>` | optional | Action parameter translations keyed by parameter name |
244-
| **resultDialog** | `{ title?: string; description?: string; acknowledge?: string; fields?: Record<string, string> }` | optional | Translations for the action result dialog |
245-
| **preflight** | `{ fields?: Record<string, string> }` | optional | Translations for the action preflight panel |
245+
| **resultDialog** | `{ title?: string; description?: string; acknowledge?: string; fields?: Record<string, string>; … }` | optional | Translations for the action result dialog |
246+
| **preflight** | `{ fields?: Record<string, string>; columns?: Record<string, Record<string, string>> }` | optional | Translations for the action preflight panel |
246247

247248
### Nested Shape: `PlatformTranslationData.dashboards[string]`
248249

@@ -421,8 +422,8 @@ Translation data for a single object
421422
| **cancelText** | `string` | optional | Translated label of the dismiss button on the action's confirm or param dialog (the action must declare `confirmText` or `params`) |
422423
| **outcomeMessages** | `Record<string, string>` | optional | Translated success copy per handler outcome, keyed by the snake_case outcome name the action's `outcomeMessages` declares |
423424
| **params** | `Record<string, { label?: string; helpText?: string; placeholder?: string; options?: Record<string, string> }>` | optional | Action parameter translations keyed by parameter name |
424-
| **resultDialog** | `{ title?: string; description?: string; acknowledge?: string; fields?: Record<string, string> }` | optional | Translations for the action result dialog |
425-
| **preflight** | `{ fields?: Record<string, string> }` | optional | Translations for the action preflight panel |
425+
| **resultDialog** | `{ title?: string; description?: string; acknowledge?: string; fields?: Record<string, string>; … }` | optional | Translations for the action result dialog |
426+
| **preflight** | `{ fields?: Record<string, string>; columns?: Record<string, Record<string, string>> }` | optional | Translations for the action preflight panel |
426427

427428
### Nested Shape: `ServedTranslationData.dashboards[string]`
428429

@@ -664,8 +665,8 @@ Translation data for a single object
664665
| **cancelText** | `string` | optional | Translated label of the dismiss button on the action's confirm or param dialog (the action must declare `confirmText` or `params`) |
665666
| **outcomeMessages** | `Record<string, string>` | optional | Translated success copy per handler outcome, keyed by the snake_case outcome name the action's `outcomeMessages` declares |
666667
| **params** | `Record<string, { label?: string; helpText?: string; placeholder?: string; options?: Record<string, string> }>` | optional | Action parameter translations keyed by parameter name |
667-
| **resultDialog** | `{ title?: string; description?: string; acknowledge?: string; fields?: Record<string, string> }` | optional | Translations for the action result dialog |
668-
| **preflight** | `{ fields?: Record<string, string> }` | optional | Translations for the action preflight panel |
668+
| **resultDialog** | `{ title?: string; description?: string; acknowledge?: string; fields?: Record<string, string>; … }` | optional | Translations for the action result dialog |
669+
| **preflight** | `{ fields?: Record<string, string>; columns?: Record<string, Record<string, string>> }` | optional | Translations for the action preflight panel |
669670

670671
### Nested Shape: `TranslationData.dashboards[string]`
671672

@@ -876,8 +877,8 @@ Translation data for a single object
876877
| **cancelText** | `string` | optional | Translated label of the dismiss button on the action's confirm or param dialog (the action must declare `confirmText` or `params`) |
877878
| **outcomeMessages** | `Record<string, string>` | optional | Translated success copy per handler outcome, keyed by the snake_case outcome name the action's `outcomeMessages` declares |
878879
| **params** | `Record<string, { label?: string; helpText?: string; placeholder?: string; options?: Record<string, string> }>` | optional | Action parameter translations keyed by parameter name |
879-
| **resultDialog** | `{ title?: string; description?: string; acknowledge?: string; fields?: Record<string, string> }` | optional | Translations for the action result dialog |
880-
| **preflight** | `{ fields?: Record<string, string> }` | optional | Translations for the action preflight panel |
880+
| **resultDialog** | `{ title?: string; description?: string; acknowledge?: string; fields?: Record<string, string>; … }` | optional | Translations for the action result dialog |
881+
| **preflight** | `{ fields?: Record<string, string>; columns?: Record<string, Record<string, string>> }` | optional | Translations for the action preflight panel |
881882

882883
### Nested Shape: `TranslationItem.dashboards[string]`
883884

‎content/docs/ui/translations.mdx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export default defineStack({
7676
| Bulk-action copy on a list view (button, confirm prompt, dialog fields) | `objects.<name>._views.<view>.bulkActions.<def>.label` / `.confirmText` / `.confirmLabel` / `.params.<param>.label` / `.help` / `.placeholder` — a bulk param's hint is `help`, not `helpText` |
7777
| Action labels, confirm text, success messages, disabled reasons, param dialog submit labels, confirm and param dialog dismiss labels | `objects.<name>._actions.<action>` |
7878
| Action result dialogs (title / description / acknowledge / field labels) | `objects.<name>._actions.<action>.resultDialog` |
79+
| Column headers of a table in an action's result dialog or preflight panel | `objects.<name>._actions.<action>.resultDialog.columns.<field path>.<column path>` / `.preflight.columns.<field path>.<column path>` — a sibling of `fields`, both paths written literally, dots included |
7980
| Form sections | `objects.<name>._sections.<section>` |
8081
| Custom validation-rule messages | `objects.<name>._validations.<rule>.message` |
8182
| App navigation | `apps.<app>.navigation.<id>.label` |
@@ -159,7 +160,9 @@ is resolved by this one rule.
159160
`resultDialog` shown by actions like `create_user` (temporary password), 2FA
160161
backup codes, and OAuth client-secret rotation carries its own
161162
`_actions.<action>.resultDialog` slot (`title` / `description` / `acknowledge`
162-
and `fields` keyed by the literal result-field path, e.g. `"user.email"`).
163+
and `fields` keyed by the literal result-field path, e.g. `"user.email"`; a
164+
`format: 'table'` field's column headers sit beside `fields` under
165+
`columns.<field path>.<column path>`).
163166
`os i18n extract` emits these keys; the shipped platform dialogs ship
164167
en / zh-CN / ja-JP / es-ES copy. Separately, **platform notification and
165168
storage strings localize to the recipient's locale** — collaboration

0 commit comments

Comments
 (0)