- Without opencc-js the zh-Hant check says to run npm ci, and the other
checks still run.
- --prune handles zh-CN before zh-Hant: shippedLocales() sorts, since
git lists untracked catalogs first.
- A key missing from zh-Hant is reported once, with "run npm run i18n --
--zh-hant" when zh-CN has it; a zh-Hant entry still in English points
to zh-CN and same-as-english.json.
- 並道 -> 併道 applies only to entries whose English key says merge, so
并 (and) before 道路 or 道謝 stays 並.
- Two more corrections for strings main has added: 箇中 -> 個中 after a
count (全部 {n} 個中), and 宣佈 -> 宣布 like 發佈 and 公佈.
- zh-hant-cli.test.mjs runs the command in a throwaway repository, with
opencc-js linked as a junction, so Windows needs no symlink privilege.
zh-Hant.json does not change.
2.4 KiB
Traditional Chinese (zh-Hant)
Catalog: src/i18n/locales/zh-Hant.json. General rules: TRANSLATORS.md.
Do not translate or edit this catalog: it is generated. zh-Hant is the Simplified Chinese catalog (zh-CN, credited to abiyeenzo, #914, and EDIT-Aeterna, #979) written in Traditional characters. Wording and terminology are the same as in zh-CN; only the script differs. To add or change an entry, edit zh-CN.md and the zh-CN catalog, then run:
npm run i18n -- --zh-hant # rewrite zh-Hant.json from zh-CN.json
npm test fails when zh-Hant.json differs from the conversion of zh-CN.json, naming the entry, and npm run i18n -- --missing zh-Hant points to this command instead of printing a template.
The command converts with OpenCC s2tw (opencc-js, cn → tw), which changes characters only. Never s2twp: it also swaps in Taiwan vocabulary (影片, 伺服器, 載入, 圖示), which this catalog does not use. After the conversion it fixes the characters OpenCC picks wrongly here: 年曆史 → 年歷史, 下遊 → 下游, 並道 → 併道 (only in entries whose English key says merge), 發佈 → 發布, 公佈 → 公布, 宣佈 → 宣布, 控制檯 → 控制台, 箇中 → 個中 (全部 {n} 個中), and 周 → 週 in 周/秒 (1 週/秒, weeks per second). OpenCC writes 週 itself in 每週, 本週, 上週, 一週 and 兩週, but not after a number (過去 2 周, {count} 周前): a new string like that needs its own pair. The list is ZH_HANT_CORRECTIONS in scripts/i18n.mjs; when the conversion picks another wrong character, add the pair there (with a key pattern if it is right only in some entries) and run the command.
An entry zh-CN keeps in English on purpose needs the same line under zh-Hant in src/i18n/same-as-english.json.
Style
- Wording, punctuation, spacing, units and the glossary are those of zh-CN.md, written in Traditional characters.
- Relative-time placeholders may already include 前. In
LIVE · updated {age}, the caller supplies the complete relative age; do not append another 前. - The picker displays 中文(繁體) / Chinese (Traditional); explicit Hans tags select Simplified Chinese.
Plurals
Intl.PluralRules('zh-Hant') uses only other. The measure words come from the zh-CN entry: 「{count} 架飛機」、「{count} 艘船」.