Files
skillshare/internal
Willie f0270c371b refactor(ui): let i18n own key validity and plural selection
The i18n module guaranteed parity between locales and left the rest to
callers. `t` takes any string, so a mistyped key rendered as the key and
nothing caught it; internal/plugin sends translation keys that nothing
compared with en.json; and about 130 call sites chose between `.one` and
`.other` by hand.

- keys.test.ts reads the dashboard source and fails on a key that is not
  in en.json. A key built at run time is checked by its fixed head, and a
  string that only looks like a key is named in a short documented list.
- internal/plugin/i18n_keys_test.go fails when a "plugins." literal the
  package emits is missing from en.json; the one key completed at run
  time lists its values.
- plural(key, count) in the i18n module picks the form, with the same
  "exactly 1" split the call sites used, so every rendered string is
  unchanged. No locale file changed.

Refs #448
2026-10-07 00:12:35 +08:00
..