Commit b8365eb
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: Tyler Gray <tylerg@emergentsoftware.net>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 250776a commit b8365eb
3 files changed
Lines changed: 734 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | | - | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | | - | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
| |||
0 commit comments