feat: add Traditional Chinese (zh-tw) locale#219
Open
MakiDevelop wants to merge 4 commits intoshareAI-lab:mainfrom
Open
feat: add Traditional Chinese (zh-tw) locale#219MakiDevelop wants to merge 4 commits intoshareAI-lab:mainfrom
MakiDevelop wants to merge 4 commits intoshareAI-lab:mainfrom
Conversation
Add Traditional Chinese with Taiwan phrasing as a new locale alongside existing en/zh/ja. All docs are converted from Simplified Chinese via OpenCC s2twp (智能体→智慧體, 循环→迴圈, 代码→程式碼, 内存→記憶體, etc). Changes: - Add docs/zh-tw/ (36 files, converted from docs/zh/ via opencc -c s2twp.json) - Add web/src/i18n/messages/zh-tw.json (UI strings) - Register zh-tw in i18n provider, root layout, locale switcher, and static params generator - Update extract-content.ts to detect zh-tw subdirectory - Widen DocContent.locale union to include "zh-tw" UI chrome for zh-tw falls back to English where inline literal copy objects aren't yet translated (same behaviour as ja currently). Main doc body content is fully Traditional Chinese. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
@MakiDevelop is attempting to deploy a commit to the crazyboym's projects Team on Vercel. A member of the Team first needs to authorize it. |
- 四語系 OG 圖(en/zh/zh-tw/ja,Gemini 3 Pro 生成,1200x630) - layout.tsx 按 locale 對應 og:image,補 metadataBase / openGraph / twitter card - 字體大小切換小/中/大(html font-size 14/16/18px,整站 rem 連動) - Header desktop + mobile menu 各加一組「A A A」選擇器 - localStorage 持久化 + <head> inline script 避免 FOUC Co-Authored-By: Claude Opus 4.6 <[email protected]>
36897b1 to
d882d01
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add Traditional Chinese with Taiwan phrasing (
zh-tw) as a new locale, sitting alongside existingen/zh/ja.All doc content is converted from existing Simplified Chinese (
docs/zh/) via OpenCC'ss2twpprofile, which produces Traditional Chinese with Taiwan vocabulary (e.g. 智能体→智慧體, 循环→迴圈, 代码→程式碼, 内存→記憶體, 数据库→資料庫).Why
Readers in Taiwan and Hong Kong generally prefer Traditional characters plus localised tech vocabulary over direct Simplified→Traditional character conversion.
s2twphandles both in one pass.Changes
docs/zh-tw/— 36 files converted fromdocs/zh/viaopencc -c s2twp.jsonweb/src/i18n/messages/zh-tw.json— UI string cataloguezh-twin:web/src/lib/i18n.tsx(I18nProvider message map)web/src/app/[locale]/layout.tsx(generateStaticParams + metadata)web/src/components/layout/header.tsx(locale switcher, label繁中)web/src/app/[locale]/(learn)/docs/[slug]/page.tsx(SUPPORTED_LOCALES)web/scripts/extract-content.ts— detectzh-tw/subdirectory (ordered beforezh/check)web/src/types/agent-data.ts— widenDocContent.localeunionweb/src/data/generated/docs.json— regenerated build artefactNotes
Some page-level inline copy objects (e.g. the s01 agent loop page's
COPYrecord) still use narrow"en" | "zh" | "ja"keys. For those pages, zh-tw readers will see English chrome copy, the same fallback behaviour thatjacurrently hits in a few places. Main article body content is fully Traditional Chinese. Filling in the per-page zh-tw copy can be a follow-up.Test plan
pnpm buildsucceeds (static export passes)/zh-twroute generates for all 36 docs繁中and routes correctly between en ↔ zh ↔ zh-tw ↔ ja🤖 Generated with Claude Code