Skip to content

feat(i18n): ADR-0029 D8 — migrate i18n ownership for moved domains to their plugins#1451

Merged
os-zhuang merged 1 commit into
mainfrom
claude/adr-0029-d8-i18n-migration
Jun 1, 2026
Merged

feat(i18n): ADR-0029 D8 — migrate i18n ownership for moved domains to their plugins#1451
os-zhuang merged 1 commit into
mainfrom
claude/adr-0029-d8-i18n-migration

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

Closes the ADR-0029 D8 follow-up tracked since K2.a: the object i18n for the already-moved domains lived in the @objectstack/platform-objects generated bundles even though the objects now live in their capability plugins. This migrates each domain's i18n extraction + bundles + runtime loading to the owning plugin, preserving every hand-translated string (zh-CN / ja-JP / es-ES).

Done with the real os i18n extract tooling (not hand-edited generated files), as requested.

Per plugin

Each plugin gains:

  • a build-time scripts/i18n-extract.config.ts (self-baselined against its own generated bundles so --merge re-runs preserve translations);
  • a src/translations/ bundle — {en,zh-CN,ja-JP,es-ES}.objects.generated.ts + an index.ts barrel exporting a TranslationBundle;
  • a kernel:ready hook that loads the bundle via i18n.loadTranslations (best-effort; the i18n service is optional).
Plugin Objects Keys/locale
plugin-webhooks sys_webhook, sys_webhook_delivery 69
plugin-approvals sys_approval_request, sys_approval_action 60
plugin-security sys_role, sys_permission_set, sys_user_permission_set, sys_role_permission_set 86
plugin-sharing sys_record_share, sys_sharing_rule, sys_share_link 121

platform-objects

Regenerated its translation bundles (its extract config already excluded these objects). The moved objects' keys are dropped; all other objects' translations and the metadata-form bundles are preserved (objects: 1634 keys/locale + 430 metadataForms).

How the seed preserved translations

Each plugin's extract was first run with a temporary baseline pointing at platform-objects' existing bundles + a --filter for that plugin's objects, so the hand-translated zh-CN/ja-JP/es-ES strings carried over; the committed config then self-baselines for future runs.

Verification

  • Moved objects gone from platform-objects bundles (sys_webhook/sys_approval_request/sys_role/… = 0); retained objects intact (sys_user = 1).
  • zh-CN preserved in plugin bundles (e.g. sys_role → "角色", sys_approval_request → "审批请求", sys_webhook description in Chinese).
  • turbo build (5 packages + dep graph, incl. DTS type-check): green
  • Tests: platform-objects 58 / plugin-webhooks 45 / plugin-approvals 30 / plugin-security 76 / plugin-sharing 54 — green

Notes

  • Atomic by necessity: platform-objects can only be regenerated once all moved domains own their bundles (otherwise their translations would be dropped before the plugins provide them) — hence all four in one PR.
  • Includes the driver-mongodb CI-skip fix already on main, so Test Core should be green.

https://claude.ai/code/session_01Tv6F1Ub6bhCedrx3r8sZM4


Generated by Claude Code

… their plugins

The object translations for the webhooks/approvals/security(RBAC+sharing)
domains lived in the platform-objects generated bundles even though the objects
now live in their capability plugins. Move each domain's i18n extraction +
bundles to the owning plugin, preserving every hand-translated zh-CN/ja-JP/es-ES
string via `os i18n extract --merge`.

Per plugin: a build-time scripts/i18n-extract.config.ts (self-baselined) + a
src/translations/ bundle (objects.generated per locale + index barrel) + a
kernel:ready hook that loads it via i18n.loadTranslations (best-effort).

- plugin-webhooks  <- sys_webhook, sys_webhook_delivery
- plugin-approvals <- sys_approval_request, sys_approval_action
- plugin-security  <- sys_role, sys_permission_set, sys_user_permission_set, sys_role_permission_set
- plugin-sharing   <- sys_record_share, sys_sharing_rule, sys_share_link

platform-objects translation bundles regenerated to drop those objects' keys
(its extract config already excluded them); all other objects + metadata-form
bundles preserved. Verified: moved objects gone from platform-objects, retained
objects (sys_user) intact, zh-CN translations preserved in the plugin bundles.

Tests: platform-objects 58 / plugin-webhooks 45 / plugin-approvals 30 /
plugin-security 76 / plugin-sharing 54 — green; turbo build (incl. DTS) green.

https://claude.ai/code/session_01Tv6F1Ub6bhCedrx3r8sZM4
@vercel

vercel Bot commented Jun 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 1, 2026 6:05am

Request Review

@github-actions github-actions Bot added documentation Improvements or additions to documentation tooling size/xl labels Jun 1, 2026
@os-zhuang os-zhuang marked this pull request as ready for review June 1, 2026 06:58
@os-zhuang os-zhuang merged commit 4404572 into main Jun 1, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/xl tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants