@courthive/i18n 0.4.9 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -3
- package/dist/locales/ar.json +626 -20
- package/dist/locales/cs.json +626 -20
- package/dist/locales/de.json +626 -20
- package/dist/locales/en.json +331 -31
- package/dist/locales/es.json +626 -20
- package/dist/locales/fr.json +626 -20
- package/dist/locales/hr.json +626 -20
- package/dist/locales/pt-BR.json +626 -20
- package/dist/locales/zh-CN.json +626 -20
- package/dist/manifest.gen.d.ts +12 -2
- package/dist/manifest.gen.js +22 -9
- package/dist/manifest.json +37 -37
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -21,6 +21,10 @@ src/
|
|
|
21
21
|
zh-CN.json
|
|
22
22
|
scripts/
|
|
23
23
|
compare-keys.cjs # CI gate: fails on key drift / duplicate keys
|
|
24
|
+
merge-source-en.cjs # Merges a consumer's en.json in; seeds __TODO__ / __STALE__
|
|
25
|
+
copy-locales.cjs # src -> dist; drops __TODO__, unwraps __STALE__
|
|
26
|
+
check-dist-no-todo.cjs # Build gate: no sentinel may reach dist
|
|
27
|
+
todo-report.cjs # Backlog report consumed by i18n-todo-reminder
|
|
24
28
|
install-husky-hooks.cjs # Copies scripts/husky/* into .husky/ on prepare
|
|
25
29
|
husky/
|
|
26
30
|
pre-commit # Hook body (lint + check-types + compare-keys)
|
|
@@ -37,9 +41,31 @@ scripts/
|
|
|
37
41
|
completeness, RTL flag) used by CFS to serve `GET /i18n/manifest`.
|
|
38
42
|
- `dist/index.js` + `.d.ts` — re-exports the manifest type and labels.
|
|
39
43
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
## The two translator sentinels
|
|
45
|
+
|
|
46
|
+
`completeness = 1 - ((__TODO__ + __STALE__ count) / total keys)`, measured
|
|
47
|
+
against `src` — the only tree where the sentinels still exist.
|
|
48
|
+
|
|
49
|
+
| sentinel | means | shape in `src` | what `dist` ships | what the user sees |
|
|
50
|
+
| ----------- | ------------------------------------------------------------------ | -------------------------------------- | ------------------------------------- | ---------------------------------- |
|
|
51
|
+
| `__TODO__` | no translation yet | replaces the value | key **dropped** | English (i18next per-key fallback) |
|
|
52
|
+
| `__STALE__` | a translation exists, but the English it was made from has changed | **prefix** on the retained translation | prefix **stripped**, translation kept | the old translation |
|
|
53
|
+
|
|
54
|
+
`merge-source-en.cjs` seeds both: `__TODO__` for keys the source adds,
|
|
55
|
+
`__STALE__` for keys whose English value changes under an existing
|
|
56
|
+
translation. Translators fill in / confirm them and merge a follow-up PR
|
|
57
|
+
that brings completeness back to 1.0.
|
|
58
|
+
|
|
59
|
+
`__STALE__` is deliberately a _prefix_, not a replacement value. Replacing
|
|
60
|
+
the value and dropping it like `__TODO__` would make the key **absent**, and
|
|
61
|
+
an absent key falls back to English — so a copy edit in English would
|
|
62
|
+
silently un-translate the string for every non-English user. Keeping the
|
|
63
|
+
translation on screen while the metric counts it as debt is the trade.
|
|
64
|
+
|
|
65
|
+
Neither sentinel may reach `dist`: `check-dist-no-todo.cjs` fails the build
|
|
66
|
+
on either. A shipped `__TODO__` renders literally (this was live in
|
|
67
|
+
production on 2026-08-16 — a French TD read `__TODO__` in the schedule UI);
|
|
68
|
+
a shipped `__STALE__` would prepend the marker to a real translation.
|
|
43
69
|
|
|
44
70
|
## Scripts
|
|
45
71
|
|