Files
dsh-context/tests
bowenliang123 209169df86 refactor(i18n): check the en dictionary against zh at compile time
Both dictionaries were annotated Record<string, string>, which is an
index signature and a promise of nothing: a key added to zh alone, or
to en alone, typechecked and shipped. The only gate was a runtime
deepEqual in the spec, so the asymmetry reached a built bundle before
anything failed.

zh is now the key-set source of truth and en is checked against it, the
harness's own idiom (see ui-conversation/src/client/locales.ts in
deepseek-harness, where 51 of 61 locale files do this). A key reaching
only one side is now a compile error, verified in both directions.

The spec keeps what types cannot see — non-empty values and placeholder
agreement — and drops the key-set test, which can no longer fail.

Translate keeps its key as string. Call sites compose keys at runtime
(`'form.' + form`, a weekday template), so a DictKey union would mean a
cast at each one, and the cast would suppress the check this change
buys.
2026-10-10 12:55:43 +08:00
..