chinese2english/scripts
spearzificial 23327d2bd5 feat: translate code comments, reaching zero Chinese in the served UI
The last Chinese lived in source comments: notes the plugin authors wrote
about why a module exists and which bug it fixed, plus two stylesheet
comment blocks. Comments never render, but they still shipped Chinese, and
the user asked for all of it gone.

- src/dictionary.comments.json: 274 whole comments (block and line form).
- src/rewrite.ts: rewriteComments replaces a comment only on an exact
  whole-comment match, so box-drawing runs and the `*` alignment that give
  these notes their structure cannot be reflowed by a partial replacement.
  Comment rewriting runs on the source between literals; running it over
  the assembled output would also scan literal contents, where a URL like
  `https://…` reads as a line comment.
- scripts/merge-comments.mjs emits the dictionary and enforces the
  invariants: no CJK, delimiters preserved and balanced, line count
  unchanged, box runs preserved in block comments. In a single-line `//`
  banner the run is decoration and may shift with the text.

Verified on the bytes a fresh instance actually served, escapes decoded:
total Chinese 55,345 -> 111 (99.80% removed). In the browser, both visible
text and the full page HTML report 0 CJK.

The 111 characters left are inside functional regular expressions that
match Chinese *input*: /失败|错误|无法/ classifies a status message,
dshmarket's PREVIEW_WORDS match Chinese plugin descriptions, and
/^[一-龥]{2}$/ validates a two-character name. Translating those would
break plugin behaviour, so they are deliberately left alone.
2026-10-18 22:25:19 +05:30
..
build.mjs fix: translate plugin bundles at the transport layer 2026-10-15 22:53:20 +05:30
merge-comments.mjs feat: translate code comments, reaching zero Chinese in the served UI 2026-10-18 22:25:19 +05:30
merge-dict.mjs feat: translate 100% of served UI literals, including template literals 2026-10-18 20:22:35 +05:30
mt-fill.mjs feat: translate 100% of served UI literals, including template literals 2026-10-18 20:22:35 +05:30