Skip to content

fix(i18n): write 簽 not 籤 in generated zh-Hant (#366) - #370

Merged
zhuangjianguo merged 2 commits into
mainfrom
claude/project-thread-zpl8n0
Oct 28, 2026
Merged

zhuangjianguo merged 2 commits into
mainfrom
claude/project-thread-zpl8n0

Conversation

@zhuangjianguo

Copy link
Copy Markdown
Collaborator

Requested by Steedos · project thread

Fixes #366

What changed

OpenCC's twp preset maps Simplified 签 to 籤 (slip, tag) where Taiwan writes 簽 (sign): it has no phrase for 签核 / 会签, and it segments 请求签名 as 请 + 求签 + 名 and 中签发 as 中签 + 发.

apps/docs/scripts/gen-zh-hant.mjs now runs an ordered list of exact [wrong, right] pairs on the converter's output:

pair source
籤核 → 簽核 签核 sign off
會籤 → 會簽 会签 countersign
籤名 → 簽名 请求签名
籤發 → 簽發 中签发 / 上签发

標籤 and 書籤 are swapped for private-use stand-ins before the pairs run and swapped back after, so no pair can reach into them (标签名 → 標籤名 would otherwise become 標簽名). The layer lives inside convert(), so it sees exactly the prose runs and the meta / fixed-pair JSON the converter sees; fences still bypass both. A source containing a private-use code point is refused rather than risking a collision.

The whole corpus is regenerated. Six files change, and every changed byte is 籤 → 簽 (checked by diffing old and new with 籤 folded to 簽: no other difference):

  • content/docs/use/approvals.zh-Hant.mdx
  • content/docs/build/automation/approvals.zh-Hant.mdx
  • content/docs/build/automation/index.zh-Hant.mdx
  • content/docs/build/automation/workflows.zh-Hant.mdx
  • content/docs/configure/webhooks.zh-Hant.mdx
  • content/docs/configure/mcp.zh-Hant.mdx

No zh-Hans file is touched.

Verification (local, at this head)

  • grep -rnP '(中|上|求|都|次|待|人)籤|會籤' content/docs --include=*.zh-Hant.mdx: empty.
  • Every remaining 籤 in the zh-Hant surface is inside 標籤 (0 others).
  • 標籤 count over the zh-Hant surface: 45 before, 45 after.
  • node apps/docs/scripts/gen-zh-hant.mjs --check: ✓ 81 files match byte for byte.
  • check-translations.mjs: passed. check-translation-output.mjs --files <PR diff>: passed (85 pre-existing findings reported, none in zh-Hans/zh-Hant). --self-test: passed. check-translation-ownership.mjs: passed.
  • pnpm turbo run type-check test: green. pnpm turbo run build then check-locale-surface.mjs: ✓.
  • Rendered next start and loaded the four pages named in zh-Hant: the generator writes 籤 (lottery slip) where Traditional uses 簽 (sign): 籤核, 會籤, 請求籤名, 中籤發 on landed pages #366 in Chromium: each returns 200, no 籤 outside 標籤 in the page text, and 簽核 / 會簽 / 請求簽名 / 簽發 render.

Follow-up (not in this PR)

www.objectos.ai's src/lib/zhconvert.ts runs the same cn → twp preset without this layer, so its Traditional pages likely have the same defect. That file belongs to the www site's owner; it is named here as a follow-up.


Generated by Claude Code

OpenCC's twp preset maps Simplified 签 to 籤 (slip, tag) in 签核, 会签,
and across word boundaries in 请求签名 and 中签发/上签发, where Taiwan
writes 簽 (sign). gen-zh-hant.mjs now applies an ordered list of exact
[wrong, right] pairs to the converter's output, with 標籤 and 書籤 set
aside so no pair reaches into them. Fences still bypass both. The
corpus is regenerated; every changed byte is 籤 -> 簽, and the 標籤
count is unchanged (45).

Fixes #366

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jRd8W1US76Cj78zAM8
@zhuangjianguo zhuangjianguo self-assigned this Oct 28, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor

席位核对 · REVISE · 2026-10-28T00:31Z · session_01QsR2jTaZ2GeyfjANMwstiw · seat repo:docs.objectos.ai#1

One change, then this is ACCEPTable as it stands.

  1. apps/docs/scripts/gen-zh-hant.mjs:151: the guard regex holds raw private-use bytes. od -c on the line shows [ 356 200 200 - 357 243 277 ], that is literal U+E000 and U+F8FF. The guard works, but the characters are invisible in every editor and review view. A later edit or a normalising tool can drop them silently, and the guard then matches only -. Write it as /[-]/ with the escapes typed as ASCII, and check the result with od -c before pushing. No other line of the PR needs to change.

Everything else the seat re-checked at 4ec92a5 holds:

  • With 籤 folded to 簽, every changed zh-Hant file is identical to main, so the PR changes no other bytes.
  • The only remaining 籤 are in 標籤.
  • gen-zh-hant --check reports 81 files matching byte for byte.
  • Ownership & freshness and Node floor are green, and build is pending.

…#366)

The guard regex held raw U+E000 and U+F8FF, invisible in editors and
review views and easy to drop silently. Same match, now \uE000-\uF8FF.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jRd8W1US76Cj78zAM8
@objectstack-fleet

Copy link
Copy Markdown
Contributor

席位核对 · ACCEPT · 2026-10-28T00:34Z · session_01QsR2jTaZ2GeyfjANMwstiw · seat repo:docs.objectos.ai#1

  1. Shape. Draft PR against main (4ffefcc), head 8e81f99: the original commit 4ec92a5 plus the REVISE commit, with no force-push. 7 files, +63/−16. First line Fixes #366. Claim 6457300170, branch claude/project-thread-zpl8n0. The changes stay within the claimed surface: apps/docs/scripts/gen-zh-hant.mjs and six regenerated zh-Hant pages. No zh-Hans, English, meta or fixed JSON is changed.
  2. The fix. convert() wraps the twp converter. It applies four exact pairs in order: 籤核→簽核, 會籤→會簽, 籤名→簽名, 籤發→簽發. Before the pairs run, 標籤 and 書籤 are set aside behind private-use stand-ins so that 标签名 stays 標籤名. A source that already carries a private-use code point is refused. The override runs only where the converter runs, so fences are never touched. The header comment records that this layer is the one difference from www.objectos.ai's preset.
  3. REVISE 6457394457 closed. Line 151 now reads /[-]/, typed as ASCII escapes. The seat checked the bytes at 8e81f99.
  4. Gates, seat re-run.
  5. Out of scope. www.objectos.ai src/lib/zhconvert.ts probably has the same defect. The PR body names it as a follow-up for that site's owner, and it is not this repository's to change.
  6. Landing. Tier none (generator tooling, no governed surface). Through the merge queue under the maintainer's standing go-ahead, after the main deploy for docs(i18n): zh-Hans for Deploy and the first Operate pages #369 (f44e307) smoke-checks green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zh-Hant: the generator writes 籤 (lottery slip) where Traditional uses 簽 (sign): 籤核, 會籤, 請求籤名, 中籤發 on landed pages

2 participants