mirror of
https://github.com/nexu-io/open-design.git
synced 2026-06-01 03:14:35 +07:00
Refs #1894. The existing locale-shape test (`Object.keys(dict).sort() === englishKeys`) passes for every locale today, but most modules satisfy it via `...en` spread — so an English key added without a matching translation falls back to English at runtime, the test still passes, and locale drift accumulates silently. `zh-CN.ts` is the one locale today that declares all 2302 keys explicitly, with no `...en` spread. This change pins that property as a regression test: - New: `keeps zh-CN explicitly translated for every English key (tier-1 parity lock)` — asserts the `'key':` literals in the source file match the full English key set, using the existing `explicitLocaleKeys` helper. - New: `keeps the zh-CN locale source free of the `...en` spread fallback` — paired source-grep guard so a future refactor can't sneak the spread back in. Both cases pass today without any locale-content edits (verified locally against `main` at the time of writing: 2302 explicit keys, no `...en` match). Net effect: a future PR that adds an English key must update `zh-CN` synchronously or CI fails loudly for this one locale, instead of letting the gap widen in silence. Scope kept deliberately narrow per the discussion on #1894 — this does not touch `id.ts` (which currently uses `...en`), does not change the wider policy decision (enforce all locales / tier-1 subset / report-only), and does not duplicate the `pnpm i18n:coverage` report that shipped in #1896. It just locks `zh-CN`'s current tier-1 state so the rest of the policy discussion can proceed without losing that ground. Co-authored-by: zhongrenfei1-hub <231221504+zhongrenfei1-hub@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| content.test.ts | ||
| design-files-agent-copy.test.ts | ||
| design-files-dropzone-copy.test.ts | ||
| detect-initial-locale.test.ts | ||
| locales.test.ts | ||