Skip to content

feat(i18n): add Simplified Chinese (zh-CN) localization (#219)#239

Merged
tylergraydev merged 1 commit into
mainfrom
feat/zh-cn-localization
May 17, 2026
Merged

feat(i18n): add Simplified Chinese (zh-CN) localization (#219)#239
tylergraydev merged 1 commit into
mainfrom
feat/zh-cn-localization

Conversation

@tylergraydev

Copy link
Copy Markdown
Owner

Closes #219.

What

Adds Simplified Chinese alongside existing English and Traditional Chinese. The reporter assumed React, but the app is Svelte and already has a working i18n framework with zh-TW — this just adds the third locale.

How

New locales/zh-CN.ts with all 721 strings. Initial pass is a mechanical Traditional → Simplified character conversion with CN-specific vocabulary swaps applied:

TW CN Meaning
專案 项目 project
設定 设置 settings/config
檔案 文件 file
載入 加载 load
重新整理 刷新 refresh
預設 默认 default
軟體 软件 software
影片 视频 video
儲存庫 仓库 repository
伺服器 服务器 server
訊息 消息 message
重新啟動 重启 restart
程式 程序 program
變數 变量 variable

…plus standard Traditional → Simplified character conversion throughout.

Locale switcher labels updated from EN / 中文 (ambiguous) to EN / / so users can distinguish the two Chinese options at a glance. zh-CN listed before zh-TW since CN has the larger user base; cycle order is EN → 简 → 繁 → EN.

Locale type union extended with 'zh-CN'. The existing detect logic already handles bare zh browser preferences via prefix matching — zh-CN browsers will now match directly instead of falling through to zh-TW.

Type system validates 1:1 key coverage via type Translations = Record<TranslationKey, string> where TranslationKey = keyof typeof en. npm run check confirms zero missing keys.

Native-speaker review wanted

This is a translator-as-second-language pass. Some phrasing may feel stiff or use slightly off vocabulary for the technical context. Inviting follow-up PRs from native zh-CN speakers — especially the reporter @Jedeiah who opened the original issue. The file is structured with section comments mirroring en.ts / zh-TW.ts so spot-fixes are trivial.

Test plan

  • npm run check11 errors (same as main baseline; the Translations type validated all 721 keys are present and correctly typed)
  • npx vitest run — 1567/1567 pass
  • Manual: launch app on a zh-CN system, confirm UI renders Simplified Chinese, test language switcher cycles EN → 简 → 繁

cc @Jedeiah — would love your review of the translations.

🤖 Generated with Claude Code

Closes #219.

## What

Adds Simplified Chinese alongside existing English and Traditional
Chinese. The reporter assumed React, but the app is Svelte and already
has a working i18n framework with `zh-TW` — this just adds the third
locale.

## How

- New `locales/zh-CN.ts` with all 721 strings. Initial pass is
  a mechanical Traditional → Simplified character conversion with
  CN-specific vocabulary swaps applied: 项目 (vs 專案), 设置 (vs 設定),
  文件 (vs 檔案), 加载 (vs 載入), 刷新 (vs 重新整理), 默认 (vs 預設),
  软件 (vs 軟體), 视频 (vs 影片), 仓库 (vs 儲存庫), 服务器 (vs 伺服器),
  消息 (vs 訊息), 命令 (vs 指令 for slash commands kept as 命令 to
  match CN convention), 默认 (vs 預設), 重启 (vs 重新啟動), etc.

- Locale switcher labels updated from `EN` / `中文` (ambiguous) to
  `EN` / `简` / `繁` so users can distinguish the two Chinese options
  at a glance. `zh-CN` listed before `zh-TW` since CN has the larger
  user base; cycle order is EN → 简 → 繁 → EN.

- `Locale` type union extended with `'zh-CN'`. The existing detect
  logic already handles bare `zh` browser preferences via prefix
  matching — `zh-CN` browsers will now match directly instead of
  falling through to `zh-TW`.

- TypeScript validates 1:1 key coverage via
  `type Translations = Record<TranslationKey, string>` where
  `TranslationKey = keyof typeof en`. `npm run check` confirms zero
  missing keys (still at 11-error main baseline, no new errors).

## Native-speaker review wanted

This is a translator-as-second-language pass. Some phrasing may feel
stiff or use slightly off vocabulary for the context. Inviting
follow-up PRs from native zh-CN speakers (especially the issue
reporter) — file is structured in section comments mirroring the
en/zh-TW files so spot-fixes are easy.

## Test plan

- [x] `npm run check` — 11 errors (same as main; Translations type
      validated all 721 keys present)
- [x] `npx vitest run` — 1567/1567 pass
- [ ] Manual: launch app on a `zh-CN` system, confirm UI renders
      Simplified Chinese, test language switcher cycles EN → 简 → 繁

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tylergraydev
tylergraydev merged commit b8365eb into main May 17, 2026
10 checks passed
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.

Feature Request: Full Simplified Chinese (zh-CN) localization / 完全简体中文汉化

1 participant