Skip to content

docs(i18n): add Traditional Chinese (zh-TW) locale and READMEs#2935

Open
maxmilian wants to merge 1 commit into
sipeed:mainfrom
maxmilian:docs/zh-tw-locale
Open

docs(i18n): add Traditional Chinese (zh-TW) locale and READMEs#2935
maxmilian wants to merge 1 commit into
sipeed:mainfrom
maxmilian:docs/zh-tw-locale

Conversation

@maxmilian
Copy link
Copy Markdown

@maxmilian maxmilian commented May 24, 2026

📝 Description

Add Traditional Chinese (Taiwan Mandarin) support across documentation and the frontend i18n system.

New files:

  • docs/project/README.zh-tw.md — full Traditional Chinese README
  • docs/project/CONTRIBUTING.zh-tw.md — contributor guide
  • web/frontend/src/i18n/locales/zh-TW.json — UI strings (792 keys, parity with zh.json verified via jq)

Modified:

  • web/frontend/src/i18n/index.ts — register zh-TW resource and add dayjs/locale/zh-tw import. Lower-case the incoming lng for the languageChanged handler so zh-TW / zh-Hant* / lower-cased variants land on Traditional dayjs formatting before the generic zh branch falls through to zh-cn.
  • web/frontend/src/components/app-header.tsx, web/frontend/src/routes/launcher-{login,setup}.tsx — add 繁體中文 entry to the three language switcher dropdowns
  • README.md + the 10 docs/project/README.<lang>.md files (including the new zh-tw.md) — add [繁體中文] to the language switcher row in canonical position (after Chinese), and rename the existing [中文] label to [简体中文] so the two Chinese variants are disambiguated (matches the dropdown labels which already use 简体中文 / 繁體中文)

Translation quality note: targets Taiwan Mandarin conventions (軟體, 檔案, 使用者, 螢幕, 伺服器, 儲存庫, 設定, 載入...) rather than mechanical simplified-to-traditional character conversion of zh.json / README.zh.md.

🗣️ Type of Change

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 📖 Documentation update
  • ⚡ Code refactoring (no functional changes, no api changes)

🤖 AI Code Generation

  • 🤖 Fully AI-generated (100% AI, 0% Human)
  • 🛠️ Mostly AI-generated (AI draft, Human verified/modified)
  • 👨‍💻 Mostly Human-written (Human lead, AI assisted or none)

AI drafted the three translation files; I curated the Taiwan-specific terminology, fixed the language-switcher line in the new README, wired up index.ts + the three dropdown components, ran an independent fresh-context code review (which surfaced the case-insensitivity hardening now applied), renamed [中文][简体中文] across all READMEs for disambiguation, and verified i18n key parity with jq.

🔗 Related Issue

None — greenfield translation. No prior issue or PR for zh-TW exists in the repo (verified via gh search code on zh-TW / zh-Hant / 繁體, all zero hits before this PR).

📚 Technical Context (Skip for Docs)

N/A — documentation/translation PR.

🧪 Test Environment

  • Hardware: Apple MacBook Pro (M-series)
  • OS: macOS 25.5.0 (Darwin)
  • Model/Provider: N/A — UI/docs change, no agent runtime exercised
  • Channels: N/A — no channel code touched

Verification performed

make lint-docs   # PASS — "docs lint: OK"

# i18n key parity (must be empty diff)
jq -r 'paths(scalars) | join(".")' web/frontend/src/i18n/locales/zh.json | sort > /tmp/k_zh.txt
jq -r 'paths(scalars) | join(".")' web/frontend/src/i18n/locales/zh-TW.json | sort > /tmp/k_zhtw.txt
diff /tmp/k_zh.txt /tmp/k_zhtw.txt
# (empty — 792 scalar keys in perfect parity)

# JSON validity
jq . web/frontend/src/i18n/locales/zh-TW.json > /dev/null   # valid

make check was also run. Two pre-existing test failures in pkg/tools (TestShellTool_DevNullAllowed, TestShellTool_FileURISandboxing) reproduce on a pristine upstream/main checkout — both fail with "path outside working dir" against macOS /var/folders/... symlinks, unrelated to this PR.

📸 Evidence (Optional)

Language switcher row after change (root README.md, line 21)
[简体中文](docs/project/README.zh.md) | [繁體中文](docs/project/README.zh-tw.md) | [日本語](docs/project/README.ja.md) | [한국어](docs/project/README.ko.md) | [Português](docs/project/README.pt-br.md) | [Tiếng Việt](docs/project/README.vi.md) | [Français](docs/project/README.fr.md) | [Italiano](docs/project/README.it.md) | [Bahasa Indonesia](docs/project/README.id.md) | [Malay](docs/project/README.ms.md) | **English**

☑️ Checklist

  • My code/docs follow the style of this project.
  • I have performed a self-review of my own changes.
  • I have updated the documentation accordingly.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 24, 2026

CLA assistant check
All committers have signed the CLA.

@maxmilian maxmilian force-pushed the docs/zh-tw-locale branch from 2583eb6 to c394cf6 Compare May 24, 2026 04:22
@maxmilian maxmilian marked this pull request as ready for review May 24, 2026 04:22
@maxmilian maxmilian force-pushed the docs/zh-tw-locale branch from c394cf6 to a698f94 Compare May 24, 2026 04:24
Add Traditional Chinese (Taiwan) support across documentation and the
frontend i18n system:

- docs/project/README.zh-tw.md (new): full Traditional Chinese README
- docs/project/CONTRIBUTING.zh-tw.md (new): contributor guide
- web/frontend/src/i18n/locales/zh-TW.json (new): UI strings (792 keys,
  parity with zh.json verified via jq)
- web/frontend/src/i18n/index.ts: register zh-TW resource and route to
  dayjs/locale/zh-tw (split before generic zh.startsWith branch so
  zh-Hant variants land on Traditional formatting)
- web/frontend/src/components/app-header.tsx,
  web/frontend/src/routes/launcher-{login,setup}.tsx: add 繁體中文 entry
  to language switchers
- README.md and 9 existing translated READMEs: add [繁體中文] to the
  language switcher row in canonical position (after 中文)

The translations target Taiwan Mandarin conventions (軟體, 檔案,
使用者, 螢幕, 伺服器, 儲存庫, 設定, 載入...) rather than simplified-
to-traditional character conversion of zh.json/README.zh.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@maxmilian maxmilian force-pushed the docs/zh-tw-locale branch from a698f94 to 299ce02 Compare May 30, 2026 01:59
@maxmilian
Copy link
Copy Markdown
Author

Rebased onto latest upstream/main and resolved conflicts — the PR is now mergeable again (head 299ce023).

Conflicts resolved (2 files): upstream recently added the cs (Čeština) locale, which touched the same lines as this PR's zh-TW locale. Resolution was purely additive — both locales now coexist:

  • web/frontend/src/i18n/index.ts — kept both the cs/zhTW imports and both resources entries
  • web/frontend/src/components/app-header.tsx — kept both language-switcher dropdown items (繁體中文 + Čeština)

Verified with tsc --noEmit on web/frontend (0 errors). The other 11 README files auto-merged cleanly. Ready for review whenever you have a chance — thanks! 🙏

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