Repository navigation
Commit d454ccb
feat(docs): ship zh-Hant, generated from zh-Hans and committed (#218)
* feat(docs): ship zh-Hant, generated from zh-Hans and committed
Docs shipped seven locales; the marketing site ships eight. This adds the
missing one, `zh-Hant`, the way `www.objectos.ai` already ships it in
production: derived mechanically from the Simplified pages with OpenCC's
`s2twp` preset, output committed, hand-editing gated.
Committed output rather than conversion at request time is forced by how the
locale surface is now derived. `lib/seo.ts`'s `translatedLocales()` tells a real
translation from an inherited English fallback by the identity of the source
file, so a conversion performed while rendering produces no `zh-Hant` file and
the locale would render, switch, and appear in no sitemap entry and no hreflang
alternate — invisible to the search engines this exists to reach.
Fenced code blocks are copied through byte for byte; everything outside them is
converted. The `translation:` stamp is carried across unchanged, which is
correct rather than convenient: it records the sha256 of the English sibling the
Simplified page was derived from, and the Traditional page is derived from that
same English revision, so the two go stale and fresh together.
`zh-TW`, `zh-HK` and `zh-MO` now negotiate to `zh-Hant` instead of Simplified,
and the comment saying Traditional falls back "until zh-Hant ships" is gone with
the condition it described.
opencc-js is pinned to the exact version www resolves in production (1.3.1) and
is a devDependency: the dictionaries decide the output bytes, so a floating
range would rewrite the whole committed corpus on some future install.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G5zjYc2BoFV2NjKBBapC7C
* fix(ci): compare a derived locale against its source, not against English
`check-translation-output.mjs` asks "is this file faithful to the thing it was
produced from?", and until now that thing was always the English sibling. It is
not, for a locale generated from another locale: Traditional Chinese is produced
from the Simplified page, so English is two derivations away and comparing
against it measures the wrong pair.
Measured, not predicted: comparing the 62 generated Traditional pages against
English produced 31 blocking findings, every one a verbatim re-report of a
finding already open against the Simplified page it was converted from — debt
that is unfixable in the file being accused, because that file is generated and
the fix belongs upstream. A gate that accuses a file nobody can edit, for a
defect it did not introduce, is a gate people learn to override.
Against its real source the same rules become a strict check on the CONVERTER:
the generator copies fences through byte for byte and rewrites only Han
characters outside them, so `fence`, `url`, `frontmatter` and `component` must
match the Simplified source exactly, and `length` runs at a measured 1.00x
(n=62, min 1.00, max 1.02) instead of being skipped as uncalibrated. `--calibrate`
uses the same base, or it would print a number the rule never compares against.
`unsafe` is untouched — it needs no sibling and is never scoped.
The self-test gains a three-file fixture per derived locale. Its load-bearing
case reproduces the real shape (a source page whose fence differs from English)
and asserts BOTH halves: silent against its source, and still red against
English. Without the second assertion the case would pass for a validator that
had simply stopped checking derived files at all.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G5zjYc2BoFV2NjKBBapC7C
* ci: gate the committed zh-Hant output against the generator
Committed generated output drifts unless something compares it. This
regenerates in memory and compares bytes, so a hand edit, a stale file whose
Simplified source was retired, and a converter upgrade nobody re-ran all fail
with the same one-line fix.
It runs before `type-check` because it needs no build, and because a content
drift reported as a type error is a wrong first diagnosis.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G5zjYc2BoFV2NjKBBapC7C
* docs: record that zh-Hant is generated, not translated
Both files stated a seven-locale list that is now false, and neither said what
the eighth locale is. A stale fact about locale machinery is the defect this
repo has spent the day removing, and here it is also a live hazard: the
translation pass reads TRANSLATION.md, and a pass that translates a `zh-Hant`
page from English produces a second, divergent Chinese voice that the generator
then overwrites.
The `--worklist` caveat is stated rather than fixed: it still emits `en ->
zh-Hant` items. The bad outcome is caught loudly by `gen-zh-hant.mjs --check`
rather than shipped, so this is contained; making the worklist skip derived
locales is filed separately.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G5zjYc2BoFV2NjKBBapC7C
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent e38b2bf commit d454ccb
83 files changed
Lines changed: 9096 additions & 25 deletions
File tree
- .github
- scripts
- workflows
- apps/docs
- app/[lang]
- lib
- scripts
- content/docs
- build
- automation
- data
- interface
- configure
- permissions
- deploy
- operate
- reference
- resources
- use
- docs
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
123 | 129 | | |
124 | 130 | | |
125 | 131 | | |
| |||
153 | 159 | | |
154 | 160 | | |
155 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
156 | 205 | | |
157 | 206 | | |
158 | 207 | | |
| |||
396 | 445 | | |
397 | 446 | | |
398 | 447 | | |
399 | | - | |
400 | | - | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
401 | 454 | | |
402 | | - | |
| 455 | + | |
| 456 | + | |
403 | 457 | | |
404 | 458 | | |
405 | 459 | | |
406 | 460 | | |
407 | 461 | | |
408 | 462 | | |
409 | 463 | | |
410 | | - | |
| 464 | + | |
411 | 465 | | |
412 | | - | |
| 466 | + | |
413 | 467 | | |
414 | 468 | | |
415 | 469 | | |
416 | | - | |
| 470 | + | |
417 | 471 | | |
418 | 472 | | |
419 | 473 | | |
420 | 474 | | |
421 | 475 | | |
422 | | - | |
| 476 | + | |
423 | 477 | | |
424 | | - | |
| 478 | + | |
425 | 479 | | |
426 | 480 | | |
427 | 481 | | |
| |||
466 | 520 | | |
467 | 521 | | |
468 | 522 | | |
469 | | - | |
| 523 | + | |
470 | 524 | | |
471 | 525 | | |
472 | 526 | | |
| |||
483 | 537 | | |
484 | 538 | | |
485 | 539 | | |
486 | | - | |
487 | | - | |
488 | | - | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
489 | 546 | | |
490 | 547 | | |
491 | 548 | | |
| |||
596 | 653 | | |
597 | 654 | | |
598 | 655 | | |
599 | | - | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
604 | 663 | | |
605 | 664 | | |
606 | 665 | | |
| |||
882 | 941 | | |
883 | 942 | | |
884 | 943 | | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
885 | 1067 | | |
886 | 1068 | | |
887 | 1069 | | |
| |||
930 | 1112 | | |
931 | 1113 | | |
932 | 1114 | | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
933 | 1118 | | |
934 | 1119 | | |
935 | 1120 | | |
| |||
949 | 1134 | | |
950 | 1135 | | |
951 | 1136 | | |
| 1137 | + | |
952 | 1138 | | |
953 | | - | |
954 | | - | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
955 | 1143 | | |
956 | 1144 | | |
957 | 1145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
56 | 72 | | |
57 | 73 | | |
58 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
51 | 77 | | |
52 | 78 | | |
53 | 79 | | |
| |||
71 | 97 | | |
72 | 98 | | |
73 | 99 | | |
| 100 | + | |
74 | 101 | | |
75 | 102 | | |
76 | 103 | | |
| |||
0 commit comments