diff --git a/.changeset/38793-skills-i18n-platform-apps.md b/.changeset/38793-skills-i18n-platform-apps.md new file mode 100644 index 00000000000..9fd6a7529ff --- /dev/null +++ b/.changeset/38793-skills-i18n-platform-apps.md @@ -0,0 +1,19 @@ +--- +'@objectstack/skills': patch +--- + +docs(skills): objectstack-i18n teaches that a stack may translate the platform's Setup and Account apps + +Clause-②: no +Metadata-protocol: none + +`os validate` accepts an `apps.setup` or `apps.account` key in a stack's translation bundle and the runtime applies it over the served app, but the published skill said only that a key naming nothing the metadata declares is refused. An AI author asked to translate Setup's menu either declined or declared an app of its own named `setup`. Text only: no schema, rule or runtime behaviour changes here. + +`skills/objectstack-i18n/SKILL.md`: + +- The verify line keeps its refusal sentence and scopes it: a key naming nothing the metadata declares is refused, except a platform app's. +- The key map gains one note: `apps.setup` and `apps.account` translate the platform apps a stock runtime serves; `os validate` does not judge the `navigation.{id}` ids under them, because the deployment's plugins supply those items, so the ids are read from the served app. + +The file does not grow. The new text is paid for inside it: the title line is shortened, the locale check no longer repeats "not an English `defaultLocale`" after naming the two values to declare, and three worked key paths that restated their own sentence are dropped (the child-object `inlineTitle` path, the report block path and the book group path). Each rule those paths illustrated still reads in full. + +One eval case is added: a stack that declares no `setup` app translates `apps.setup.label` and `apps.setup.navigation.nav_users.label`, and the answer must write the bundle (the navigation key and the title's `label`) and must not declare an app to carry the key. The existing case about a child grid title and a report block now names the child object, its field and the block in its prompt, since the entry file no longer spells those two paths. diff --git a/content/docs/protocol/kernel/i18n-standard.mdx b/content/docs/protocol/kernel/i18n-standard.mdx index 59e31d5399e..72c0bcaa9aa 100644 --- a/content/docs/protocol/kernel/i18n-standard.mdx +++ b/content/docs/protocol/kernel/i18n-standard.mdx @@ -1200,8 +1200,8 @@ beneath an action entry are judged the same way under either. | `{action}.resultDialog.fields.{path}` | the literal `path` of a field the action's `resultDialog.fields[]` declares — dots included, so `client.secret` is one key | | `{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 | | `{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 | -| `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) | -| `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 | +| `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); **or** a platform app a stock runtime serves that the stack does not declare itself: `setup` or `account` (`PLATFORM_PROVIDED_APP_NAMES` in `@objectstack/spec/system`). The runtime applies the key over the served app, so the stack's label is the one shown. `studio` is not one of them: a stock boot does not serve it, so `apps.studio` is an orphan. A stack that declares its own app under one of these names is judged against its own declaration | +| `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. Under a platform app the stack does not declare (`setup`, `account`) the ids are **not judged**, ids the stack itself contributes into it included: that app's menu comes from the plugins the deployment composes, which these commands cannot see, the same reason a platform object's fields are not judged. A mistyped id there is not reported and translates nothing, so read each `id` from the served app. When a `translation` item is saved through the metadata API and the host states the apps the environment serves, those served apps are the reference instead: a platform app it serves resolves with its ids judged against the served items, and one it does not serve is an orphan | | `dashboards.{dash}` / `.widgets.{id}` / `.actions.{actionUrl}` | a dashboard declared / a widget `id` on it / a header action's `actionUrl` on it | | `flows.{flow}` | a flow's machine `name`, declared | | `positions.{name}` | a position's `name`, declared, or an audience anchor (`everyone`, `guest`) | diff --git a/skills/objectstack-i18n/SKILL.md b/skills/objectstack-i18n/SKILL.md index 22274f0638d..f4642467566 100644 --- a/skills/objectstack-i18n/SKILL.md +++ b/skills/objectstack-i18n/SKILL.md @@ -16,7 +16,7 @@ metadata: tags: i18n, translation, locale, l10n, bundle, coverage --- -# Internationalization — ObjectStack I18n Protocol +# ObjectStack i18n ## First checks @@ -29,10 +29,10 @@ metadata: read by `os lint`, `os i18n check`, `os i18n extract` and label serving; `supportedLocales` are BCP-47 codes (`ja-JP`); `fallbackLocale` serves a missing translation. An app authored in English for Chinese users declares - `defaultLocale: 'zh-CN', sourceLocale: 'en'`, not an English `defaultLocale`. + `defaultLocale: 'zh-CN', sourceLocale: 'en'`. 3. **Verify**: `os i18n check` lists missing keys per locale (`--locales=zh-CN`; CI: `--strict --threshold=95`); `os validate` refuses a key naming nothing the metadata - declares (`translation-target-unknown`). + declares, except a platform app's (`translation-target-unknown`). ## A bundle @@ -105,20 +105,21 @@ hooks.{hook}: texts.{key}.message, and refusals as under _actions messages: flat dotted ids ('common.save'); dashboards, metadataForms, settingsCommon ``` +- `apps.setup` and `apps.account` translate the platform apps a stock runtime serves. + `os validate` does not judge their `navigation.{id}` ids, which the deployment's plugins + supply, so read them from the served app. - `inlineTitle` (the grid a `master_detail` or `lookup` field draws on its parent's form) and `relatedListTitle` (its related list on the parent's record page) are keys of the CHILD - object, where the field lives: `objects.crm_opportunity_line_item.fields.opportunity.inlineTitle`. - Untranslated, the authored text shows, never the child's plural label. + object, where the field lives. Untranslated, the authored text shows, never the child's + plural label. - A form's `sections` are read before `_sections`, key by key. - `columns` is a sibling of `fields`: a `format: 'table'` field's `path`, then a column's (`resultDialog: { columns: { rows: { email: '邮箱', 'error.message': '原因' } } }`). `preflight` holds `fields` and `columns` only, no `title`. - `_relatedLists.{list}` is on the parent, for a `relatedLists` entry that authors a `label`; one without has no key and shows the child field's `relatedListTitle`, else its plural label. -- A report block is keyed by its `name` - (`reports.showcase_task_overview.blocks.open_block.label`); a `books` group by its stable - `key`, never its position (`books.crm_manual.groups.getting_started.label`); its pages - localize through `doc.translations`. +- A report block is keyed by its `name`; a `books` group by its stable `key`, never its + position; its pages localize through `doc.translations`. - A flow step is keyed under `approvals`, `screens` or `nodes` (any other kind). `os i18n check` asks for a technical step (`script`, `http`, `connector_action`, `assignment`, `boundary_event`, `*_record`) only where a decision's branch leads to it. diff --git a/skills/objectstack-i18n/evals/bundles-locales-coverage.json b/skills/objectstack-i18n/evals/bundles-locales-coverage.json index dee9e27f15d..f4729af601d 100644 --- a/skills/objectstack-i18n/evals/bundles-locales-coverage.json +++ b/skills/objectstack-i18n/evals/bundles-locales-coverage.json @@ -73,7 +73,7 @@ }, { "id": 8, - "prompt": "In zh-CN the `Products` grid heading on the `crm_opportunity` form and the `Open Tasks` block heading of the joined `showcase_task_overview` report are still English.", + "prompt": "In zh-CN the `Products` grid heading on the `crm_opportunity` form, drawn by the `opportunity` field of `crm_opportunity_line_item`, and the `Open Tasks` heading of the block named `open_block` in the joined `showcase_task_overview` report are still English.", "expected_output": "`objects.crm_opportunity_line_item.fields.opportunity.inlineTitle` — the field lives on the child object, so the key is the child's, and an untranslated `inlineTitle` keeps its authored text (no fallback to the child's plural label); `reports.showcase_task_overview.blocks.open_block.label`, keyed by the block's required `name`.", "files": [], "assertions": { @@ -160,6 +160,20 @@ "must_contain": ["_relatedLists", "crm_event.related_to", "nodes", "high_value"], "must_not_contain": ["approvals.high_value", "screens.high_value"] } + }, + { + "id": 17, + "prompt": "Our stack declares one app, `crm`, and nothing named `setup`. Our zh-CN admins want the platform's Setup app titled 设置 and its Users menu entry, whose served navigation item `id` is `nav_users`, to read 用户. Can our own translation bundle carry that, or does `os validate` refuse the keys because our stack declares no `setup` app?", + "expected_output": "Yes, in the stack's zh-CN `TranslationData`: `apps: { setup: { label: '设置', navigation: { nav_users: { label: '用户' } } } }`, that is `apps.setup.label` and `apps.setup.navigation.nav_users.label`. `setup` (like `account`) is a platform app a stock runtime serves, so the key translates the served app and `os validate` does not refuse it, though the stack declares no such app. `os validate` does not judge the navigation ids under it, because the deployment's plugins supply that menu's items; so the `id` is read from the served app (here `nav_users`), never guessed. The stack declares no app of its own named `setup` to carry the key.", + "files": [], + "assertions": { + "must_contain": ["apps", "setup", "navigation", "nav_users", "用户"], + "must_contain_any": [ + ["nav_users: {", "\"nav_users\": {", "navigation.nav_users.label"], + ["label: '设置'", "label: \"设置\"", "\"label\": \"设置\""] + ], + "must_not_contain": ["defineApp", "name: 'setup'"] + } } ] }