|
| 1 | +--- |
| 2 | +"@objectstack/platform-objects": patch |
| 3 | +--- |
| 4 | + |
| 5 | +fix(i18n): platform-objects' 231 untranslated strings were 1 — close the real gap and stop the phantom (#3762) |
| 6 | + |
| 7 | +Closes the rest of #3762. The remaining item was recorded as "platform-objects |
| 8 | +is 77 strings short per locale, in `apps.*` / `dashboards.*`, and its |
| 9 | +`--objects-only` extract cannot scaffold them — needs an emit decision (drop |
| 10 | +`--objects-only`, or a companion `.apps.generated.ts`) before any translating." |
| 11 | + |
| 12 | +Measured, the premise did not hold. Of the 77 declared keys per locale, **76 |
| 13 | +were already translated** in the hand-authored `<locale>.ts` files and had been |
| 14 | +for months. Exactly one was genuinely missing — |
| 15 | +`apps.studio.navigation.nav_app_builder.label`, absent in all four locales |
| 16 | +including `en`. The 231 was a measurement artifact: this config declares |
| 17 | +SETUP_APP / STUDIO_APP / ACCOUNT_APP and SystemOverviewDashboard, but its |
| 18 | +`translations` merge baseline listed only the two GENERATED subtrees |
| 19 | +(`objects`, `metadataForms`), so coverage counted every hand-authored |
| 20 | +app/dashboard key as untranslated. |
| 21 | + |
| 22 | +**Neither proposed emit is right, and the second would have caused damage.** |
| 23 | +The Setup app is a shell of empty group anchors; its ~25 menu entries are |
| 24 | +contributed at runtime by `SETUP_NAV_CONTRIBUTIONS` and by capability plugins |
| 25 | +(ADR-0029 D7). A bundle generated from a static walk of `SETUP_APP` is |
| 26 | +therefore structurally incomplete, and regenerating over the hand-authored |
| 27 | +files would have **deleted 40 live nav translations per locale**. Dropping |
| 28 | +`--objects-only` fails differently: `kind: 'full'` folds all 803 metadata-form |
| 29 | +keys into `<locale>.objects.generated.ts` and renames the export the baseline |
| 30 | +imports. |
| 31 | + |
| 32 | +The split is correct as it stands and is now written down: `objects` / |
| 33 | +`metadataForms` are generated and gated by the bundle-drift check; `apps` / |
| 34 | +`dashboards` / `pages` are hand-authored and gated by the coverage ratchet. |
| 35 | +What was wrong was only that the baseline omitted the hand-authored half. |
| 36 | + |
| 37 | +- Extract config's `translations` now carries the per-locale assemblers, with |
| 38 | + `objects`/`metadataForms` still pinned to the committed generated files. |
| 39 | + Safe for the emit — `--objects-only` writes `data.objects` alone, so nothing |
| 40 | + added here can reach a generated bundle, and `check:i18n` stays in sync |
| 41 | + across all nine packages. |
| 42 | +- `nav_app_builder` translated in all four locales, wording taken from the |
| 43 | + repo's own precedent for "builder" (`构建器` / `ビルダー` / `generador`). |
| 44 | +- `nav_workflows` removed from all four: its menu entry is gone from |
| 45 | + `STUDIO_APP` and nothing contributes to that app, so the translation was |
| 46 | + dead. |
| 47 | +- Coverage ratchet baselined 231 → **0**, making platform-objects the ninth |
| 48 | + package where the ratchet is a strict gate — verified to go red on a single |
| 49 | + removed translation. |
| 50 | +- A local, CLI-independent parity test walks the statically declared Studio and |
| 51 | + Account navigation plus the dashboard's widgets and asserts a translation in |
| 52 | + every locale — and the reverse, that no translation survives its nav item. |
| 53 | + Both directions verified to fail before passing. |
| 54 | + |
| 55 | +An untranslated nav id is invisible in the UI — it falls back to the app's |
| 56 | +English label, so a Chinese Studio menu just shows one English entry among |
| 57 | +thirty. That is why this needed a gate rather than a one-time sweep. |
| 58 | + |
| 59 | +Still out of scope: the ~25 Setup entries contributed at runtime. Bringing them |
| 60 | +under a static gate needs either an objectql dependency in this package (it |
| 61 | +depends only on spec and metadata-core) or extractor support for |
| 62 | +`navigationContributions` — a real follow-up, not something to half-do here. |
0 commit comments