Skip to content

Commit 84674c9

Browse files
committed
docs(i18n): the served bundle leaves the server-resolved metadataForms out; changeset
Claude-Session: https://claude.ai/code/session_01Vy85beHdawtEtqNscYBy7V Co-authored-by: Claude <noreply@anthropic.com>
1 parent e2fc71e commit 84674c9

2 files changed

Lines changed: 24 additions & 3 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@objectstack/runtime': patch
4+
---
5+
6+
fix(i18n): the translation bundle a console downloads leaves out Studio's `metadataForms`
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
`GET /i18n/translations/:locale` served the i18n service's whole locale tree, so every console open downloaded `metadataForms`, the translations of Studio's metadata-type authoring forms: 75 KB of the 221 KB raw zh-CN bundle on `examples/app-crm`. No browser reads that group from the bundle. Studio's forms already arrive translated, because `GET /meta` (and `/meta/types`) resolves `metadataForms.<type>` on the server, from the same i18n service, before it serves each form.
12+
13+
The route now serves every group except the ones the server resolves itself. The spec names them in `SERVER_RESOLVED_TRANSLATION_GROUPS`, which today holds only `metadataForms`. `GetTranslationsResponseSchema.translations` is now `ServedTranslationDataSchema`: the platform face without those groups, and closed, so a body that still carries one fails it. The runtime copies the tree and never edits the service's own one, which is the tree `/meta` translates from. The `ETag` still hashes the bytes served, so a warm reopen still gets `304`.
14+
15+
What to do: nothing, unless you read `metadataForms` from this route. Authoring is unchanged. `metadataForms` stays a group on every bundle face and in the i18n service. To show a metadata form in the reader's language, read it from `GET /meta/types`, which serves it already translated.

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,9 +470,15 @@ through the one the renderer reads for that node:
470470

471471
Both run in `GET /api/v1/meta`, which serves every type's `form` and `schema`
472472
already localised for the request's locale; a client deriving the schema itself
473-
with `z.toJSONSchema` applies the second one to its own copy. Only `label`
474-
crosses over to the schema (as `title`); `helpText` and `placeholder` stay on
475-
the form.
473+
with `z.toJSONSchema` applies the second one to its own copy, over a bundle it
474+
carries itself. Only `label` crosses over to the schema (as `title`); `helpText`
475+
and `placeholder` stay on the form.
476+
477+
Because the server resolves this group, the bundle a console downloads when it
478+
opens — `GET /api/v1/i18n/translations/:locale` — leaves `metadataForms` out:
479+
`SERVER_RESOLVED_TRANSLATION_GROUPS` names it, and the response's `translations`
480+
is `ServedTranslationData`, the platform groups without it. Author it like any
481+
other group; it stays in the i18n service, which is where `/meta` reads it.
476482

477483
**Naming an item-level property** therefore has three parts, none of which is
478484
a locale-catalog entry alone: the English name is a `.meta({ title: 'Action URL' })`

0 commit comments

Comments
 (0)