Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 11 additions & 0 deletions .changeset/platform-record-page-labels-translated.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
"@objectstack/platform-objects": minor
---

The three platform record pages carry a translated label in every shipped locale.

`sys_user_detail`, `sys_organization_detail` and `sys_position_detail` each declare a page-level `label` — `User`, `Organization`, `Position` — and those three strings rendered in English in every locale, including `zh-CN`, `ja-JP` and `es-ES`. They are the only keys on those pages the extractor reaches: all three author `regions: []`, so the shared walk (which roots at `regions[].components[]`) finds nothing else, and their other 45 authored copy sites are inline locale maps under `slots.*` that already carry all four locales.

`SetupAppTranslations` now declares a `pages.*` entry for each of the three in all four locale files, so `translatePage` overlays the page label the same way it already does for the plugin-carried Setup pages. Their recorded source hashes are added alongside (`<locale>.source-hashes.ts`), so a later edit to one of the English literals marks the translations stale instead of serving a translation of a string that no longer exists.

Nothing about the pages' shape changed: `label` is still the only key the extractor offers them, and the inline maps under `slots.*` are untouched.
341 changes: 30 additions & 311 deletions packages/cli/scripts/check-app-nav-i18n.mjs

Large diffs are not rendered by default.

426 changes: 411 additions & 15 deletions packages/cli/test/platform-page-i18n-parity.test.ts

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions packages/platform-objects/scripts/i18n-extract.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,14 @@
* by `SETUP_NAV_CONTRIBUTIONS` and by capability plugins, so a bundle
* generated from a static walk of `SETUP_APP` would be structurally
* incomplete — regenerating over it would DELETE 40 live nav
* translations per locale. Their gate is `pnpm check:app-nav-i18n`
* (`packages/cli/scripts/check-app-nav-i18n.mjs`), which boots the real
* composition and judges the MERGED app — not the bundle-drift gate, and
* not the coverage ratchet.
* translations per locale. The gate for `apps` / `dashboards` is
* `pnpm check:app-nav-i18n` (`packages/cli/scripts/check-app-nav-i18n.mjs`),
* which boots the real composition and judges the MERGED app — not the
* bundle-drift gate, and not the coverage ratchet. `pages` is judged by
* `packages/cli/test/platform-page-i18n-parity.test.ts` instead: it moved
* off that roster on #15743, because a NAV roster (every entry must land a
* nav id, and `@objectstack/plugin-auth` cannot) is structurally unable to
* reach two of the six pages the platform ships.
*
* This paragraph used to end "Their gate is the coverage ratchet
* (`scripts/check-i18n-coverage.mjs`), baselined at 0 for this package",
Expand Down
9 changes: 9 additions & 0 deletions packages/platform-objects/src/apps/translations/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,5 +253,14 @@ export const en: TranslationData = {
'Give any MCP-capable AI client governed access to this environment — '
+ "every call runs under the caller's own permissions and row-level security.",
},

// The platform's own record pages (`@objectstack/platform-objects/pages`,
// contributed by plugin-auth and plugin-security). Their page-level `label`
// is the only key the extractor reaches -- everything else on them is
// authored as an inline locale map under `slots.*` (#14817). English
// mirrors the literal in the page metadata, as above.
sys_user_detail: { label: 'User' },
sys_organization_detail: { label: 'Organization' },
sys_position_detail: { label: 'Position' },
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,7 @@ export const esESSourceHashes: Readonly<Record<string, string>> = {
'pages.cloud_connection_settings.subtitle': 'f5cdd253e8ffef9f',
'pages.connect_agent.label': 'eeb174613510e87d',
'pages.connect_agent.subtitle': '2d0f9a000824e78a',
'pages.sys_user_detail.label': '6c0d22a931e235bd',
'pages.sys_organization_detail.label': '3e55836156e1c1de',
'pages.sys_position_detail.label': '9a24c02e441eb0b4',
};
5 changes: 5 additions & 0 deletions packages/platform-objects/src/apps/translations/es-ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,10 @@ export const esES: TranslationData = {
'Concede a cualquier cliente de IA compatible con MCP acceso controlado a este entorno: '
+ 'cada llamada se ejecuta con los permisos propios de quien la realiza y con seguridad a nivel de fila.',
},

// Platform record pages (#15743) -- see `en.ts` for the key set.
sys_user_detail: { label: 'Usuario' },
sys_organization_detail: { label: 'Organización' },
sys_position_detail: { label: 'Posición' },
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,7 @@ export const jaJPSourceHashes: Readonly<Record<string, string>> = {
'pages.cloud_connection_settings.subtitle': 'f5cdd253e8ffef9f',
'pages.connect_agent.label': 'eeb174613510e87d',
'pages.connect_agent.subtitle': '2d0f9a000824e78a',
'pages.sys_user_detail.label': '6c0d22a931e235bd',
'pages.sys_organization_detail.label': '3e55836156e1c1de',
'pages.sys_position_detail.label': '9a24c02e441eb0b4',
};
5 changes: 5 additions & 0 deletions packages/platform-objects/src/apps/translations/ja-JP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,10 @@ export const jaJP: TranslationData = {
subtitle:
'MCP 対応の AI クライアントにこの環境への統制されたアクセスを許可します。すべての呼び出しは、呼び出し元自身の権限と行レベルセキュリティのもとで実行されます。',
},

// Platform record pages (#15743) -- see `en.ts` for the key set.
sys_user_detail: { label: 'ユーザー' },
sys_organization_detail: { label: '組織' },
sys_position_detail: { label: 'ポジション' },
},
};
10 changes: 7 additions & 3 deletions packages/platform-objects/src/apps/translations/source-hash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,13 @@
* `app-nav-translation-parity.test.ts` fails the build when `en.ts` stops
* matching the declared `SETUP_APP` / `STUDIO_APP` / `ACCOUNT_APP` /
* `SystemOverviewDashboard` literals verbatim.
* - `pages.*` — `check:app-nav-i18n` compares the `en` copy against the
* composed page metadata (those sources live in `@objectstack/cloud-connection`
* and `@objectstack/mcp`, which this package does not and must not depend on).
* - `pages.*` — `packages/cli/test/platform-page-i18n-parity.test.ts` compares
* the `en` copy against the page metadata. Those sources live in
* `@objectstack/cloud-connection`, `@objectstack/mcp` and this package's own
* `pages` barrel; the first two are packages this one does not and must not
* depend on, which is why the assertion sits in `packages/cli`. It moved
* there from `check:app-nav-i18n` on #15743 — that gate's roster is a NAV
* roster and could not reach the two `plugin-auth` pages at all.
*
* So hashing `en` transitively hashes the declared source, and this module needs
* to import nothing but the bundle sitting next to it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,7 @@ export const zhCNSourceHashes: Readonly<Record<string, string>> = {
'pages.cloud_connection_settings.subtitle': 'f5cdd253e8ffef9f',
'pages.connect_agent.label': 'eeb174613510e87d',
'pages.connect_agent.subtitle': '2d0f9a000824e78a',
'pages.sys_user_detail.label': '6c0d22a931e235bd',
'pages.sys_organization_detail.label': '3e55836156e1c1de',
'pages.sys_position_detail.label': '9a24c02e441eb0b4',
};
5 changes: 5 additions & 0 deletions packages/platform-objects/src/apps/translations/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,5 +180,10 @@ export const zhCN: TranslationData = {
label: '连接智能体',
subtitle: '让任意支持 MCP 的 AI 客户端受控访问此环境——每次调用都在调用者自身的权限与行级安全范围内执行。',
},

// Platform record pages (#15743) -- see `en.ts` for the key set.
sys_user_detail: { label: '用户' },
sys_organization_detail: { label: '组织' },
sys_position_detail: { label: '岗位' },
},
};
Loading