Skip to content

Add Hong Kong Traditional Chinese (zh-HK) - #1

Merged
idoubi merged 1 commit into
thinkany-ai:mainfrom
Bin-Huang:claude/traditional-chinese-i18n-7c44bd
Oct 9, 2026
Merged

idoubi merged 1 commit into
thinkany-ai:mainfrom
Bin-Huang:claude/traditional-chinese-i18n-7c44bd

Conversation

@Bin-Huang

Copy link
Copy Markdown
Contributor

Summary

Add zh-HK (Traditional Chinese, Hong Kong wording) to the three surfaces that already support i18n: the admin console, the public docs and GET /v1/connectors.

  • Locale tags: use region tags (zh-CN / zh-HK, later zh-TW), because the copy carries regional wording, not only a different script.
  • Negotiation (src/i18n.ts): Intl.Locale.maximize() picks the script. zh-HK, zh-MO, zh-TW and zh-Hant resolve to zh-HK. zh, zh-SG and zh-Hans resolve to zh-CN. Accept-Language is ordered by q-value and q=0 is skipped.
  • Copy source: zh-HK is derived from zh-CN with opencc-js (Simplified to Traditional glyphs, Taiwan glyph set) plus a short list of Hong Kong terms (帳戶, 登入, 建立, 儲存, 伺服器…). Docs and connector text convert at runtime, so they stay in sync with the zh-CN source.
  • Console: public/admin-i18n.js gets a static zh-HK dictionary and zh-HK templates for dynamic messages. A test requires every console string to equal the server conversion, so a missing translation fails CI.
  • Docs: language picker with 繁體中文(香港), ?lang=zh-HK links and hreflang alternates.
  • API/SDK: lang=zh-HK accepted; SDK type and docs updated.

Notes

  • New runtime dependency: opencc-js (about 6 MB unpacked).
  • The Hong Kong term list has not been reviewed by a native speaker yet.
  • Not covered: end-user connect result pages (src/pages.ts, Chinese only today) and README.

Test plan

  • npm run typecheck, npm run build
  • npm test (59 passed)
  • Checked the console (overview, settings language switch) and the docs site in zh-HK in a browser
  • npm run test:browser (needs TEST_DATABASE_URL, not run)

🤖 Generated with Claude Code

…nnector API

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@idoubi
idoubi merged commit 199ee53 into thinkany-ai:main Oct 9, 2026
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.

2 participants