You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cli): gate generated translation bundles with os i18n extract --check (#3683)
* feat(cli): gate generated translation bundles with `os i18n extract --check`
The generated translation bundles had no freshness gate. Nothing failed when
they fell behind the schema, so they only ever got fixed when someone happened
to re-run the extractor by hand — and by the time anyone did (#3670), three
distinct drifts had accumulated at once:
- translations left behind for keys the schema had REMOVED (`enable.trash` /
`enable.mru`, #2377; agent `visibility`, #1901) — keys the schema now
rejects outright;
- keys the schema had GAINED with no entry in any locale
(`summaryOperations.*`, the ADR-0105 D8 invitation-placement fields, and
the better-auth 1.7 columns from #3647);
- `sys_migration` committed with EMPTY STRINGS for its labels in ja-JP and
es-ES, which renders blank rather than falling back to anything readable.
This is the same shape as #3624: an artifact and its source with no gate
between them, so the gap is only found by accident. #3647 closed that one for
better-auth's columns by deriving the expected surface and failing the build;
this does the same for translations.
`--check` renders exactly what a real extract would write — both branches
iterate one shared rendered set, so the check cannot drift from the writer —
then compares against `--out` instead of writing, listing every stale or
missing file and printing the regenerate command. It runs in merge mode like
any other extract, so it never asks for re-translation: an up-to-date bundle
re-extracts byte-identically.
The flag lives on the CLI rather than in a repo script, so any consumer that
ships generated bundles can gate them the same way. Here it is `pnpm
check:i18n`, wired into lint.yml beside the other post-build consumer gates
(it reads the built spec dist through the extract config).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UYLC8TfjzHGwatNxZKdX7H
* docs(i18n): document the extract --check freshness gate
The docs and the i18n skill both presented `os i18n check` as *the* CI gate.
It is the coverage gate — it answers 'are the strings translated?'. For anyone
committing generated bundles that leaves the other half unguarded: renaming a
label, adding an object, or removing a spec key keeps coverage at 100% while
the bundles quietly go stale.
Documents the two as a pair, in both surfaces, since the skill is what ships to
third parties via `npx skills add`.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UYLC8TfjzHGwatNxZKdX7H
---------
Co-authored-by: Claude <noreply@anthropic.com>
|`content/docs/references/`|**AUTO-GEN**| ❌ Never hand-edit. Regenerated by `packages/spec/scripts/build-docs.ts`. |
191
+
|`packages/platform-objects/src/apps/translations/*.generated.ts`|**AUTO-GEN**| ❌ Never hand-edit. Run `pnpm i18n:extract` (merge mode — existing translations are preserved). `pnpm check:i18n` gates it in CI. |
191
192
|`content/docs/guides/`| hand-written | ✅ Update `meta.json` when adding pages. |
0 commit comments