Skip to content

feat(desktop): add Japanese, Korean, and Traditional Chinese UI locales#717

Merged
NanmiCoder merged 3 commits into
NanmiCoder:mainfrom
TW199501:feat/i18n-ja-ko-zh-tw
Jun 4, 2026
Merged

feat(desktop): add Japanese, Korean, and Traditional Chinese UI locales#717
NanmiCoder merged 3 commits into
NanmiCoder:mainfrom
TW199501:feat/i18n-ja-ko-zh-tw

Conversation

@TW199501
Copy link
Copy Markdown
Contributor

@TW199501 TW199501 commented Jun 3, 2026

What

Add three UI locales to the desktop app — Japanese (jp), Korean (kr), and Traditional Chinese (zh-TW) — and wire them into the i18n runtime. Users can now switch among English / 简体中文 / 繁體中文 / 日本語 / 한국어 in Settings → General → Language.

Changes

  • New locale files desktop/src/i18n/locales/{jp,kr,zh-TW}.ts with full TranslationKey coverage (1585 keys each, identical key set to en.ts).
  • Register the locales in i18n/index.ts and extend the Locale union.
  • settingsStore.getStoredLocale validates and accepts the new codes (default stays zh).
  • Language-switcher entries added in Settings.tsx (简体中文 / 繁體中文 / 日本語 / 한국어).
  • Localize chat message timestamps in formatMessageTimestamp.ts: Han 年月日 for zh / zh-TW / jp, and Intl ko-KR (년/월/일, never Han) for Korean.
  • Extend the DATE_LOCALES map in ActivitySettings.tsx (ja-JP / ko-KR / zh-TW).
  • Placeholders, brand names, and technical terms (MCP, Telegram, App Secret, worktree, …) are preserved untranslated.
  • Korean terminology follows the Microsoft Korean localization style guide (새로 고침, 사용 / 사용 안 함, 이름 바꾸기, 합니다-style sentences).

Tests

  • desktop/src/lib/formatMessageTimestamp.test.ts — jp / kr / zh-TW date-format branches.
  • desktop/src/i18n/index.test.tsx — every registered locale resolves, plus param interpolation.

Local verification

  • cd desktop && bun run lint → 0 errors
  • cd desktop && bunx vitest run → 128 files / 1066 tests pass (incl. 9 new)
  • bun run verify (root PR gate) — desktop lane passed.

Note: the quarantine / policy / coverage lanes fail on this branch due to pre-existing expired quarantine review dates (server:cron-scheduler, server:providers-real, server:tasks, server:e2e:* — all unrelated to this change), and native needs the bundled bun sidecar toolchain. These fail identically on a clean main and are not introduced by this PR.

Risk

Frontend-only locale addition. No behavior change for the existing en / zh defaults; the message-timestamp refactor keeps en and zh output byte-identical (covered by existing tests).

Add jp / kr / zh-TW translations and wire them into the i18n runtime so the
desktop app can switch among English, Simplified Chinese, Traditional Chinese,
Japanese, and Korean.

- new locale files jp.ts / kr.ts / zh-TW.ts with full TranslationKey coverage
- register the locales in the i18n index and extend the Locale union
- accept the new codes in settingsStore.getStoredLocale (default stays zh)
- add language-switcher entries (简体中文 / 繁體中文 / 日本語 / 한국어)
- localize chat message timestamps: Han 年月日 for zh/zh-TW/jp, Intl ko-KR for kr
- extend the DATE_LOCALES map in ActivitySettings (ja-JP / ko-KR / zh-TW)
- tests: formatMessageTimestamp locale branches + i18n locale resolution

Korean terminology follows the Microsoft Korean localization style guide
(새로 고침 / 사용·사용 안 함 / 이름 바꾸기, 합니다-style sentences).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Jun 3, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

PR quality triage

Changed areas: area:desktop

CLI core policy: No CLI-core policy block detected.

Missing-test policy: No missing-test policy block detected.

Coverage baseline policy: No coverage-baseline policy block detected.

CLI core files:

  • none

Coverage policy files:

  • none

Expected checks:

  • change-policy
  • desktop-checks
  • desktop-native-checks
  • coverage-checks

Test coverage signals:

  • No obvious missing-test signal from changed paths.

Risk notes:

  • Desktop state/API layer changed: verify store persistence, WebSocket behavior, and startup errors.

Hard merge gates still come from GitHub Actions, not AI review.

Dosu handoff: Dosu can be used as the AI reviewer for risk explanation, missing-test prompts, and maintainer Q&A. If it does not comment automatically from the PR template, ask:

@dosubot review this PR for changed-area risk, missing tests, docs impact, desktop startup risk, and CLI core impact.

@TW199501
Copy link
Copy Markdown
Contributor Author

TW199501 commented Jun 3, 2026

請您在確認下看看內容可不可以

@NanmiCoder
Copy link
Copy Markdown
Owner

感谢贡献,最近发了一个大版本 0.4.0,你可能需要把最新版本的主分支同步到里的分支里面去,然后再补一下其他文件的多语言一些改动。

@TW199501
Copy link
Copy Markdown
Contributor Author

TW199501 commented Jun 3, 2026

不用客氣,我很佩服您可以寫這麼的工具,0.4.0 發布嗎

NanmiCoder and others added 2 commits June 4, 2026 23:13
Main added two TranslationKeys after this branch's base — 'thinking.labelDone'
(the "Thought" label shown after thinking completes) and
'slashCmd.agent.description' — which the jp/kr/zh-TW locale files did not yet
cover, so the Record<TranslationKey, string> contract failed tsc after merging
main. Add both keys to each new locale:

- jp: '思考完了' / '選択した Agent でプロンプトを実行'
- kr: '사고 완료' / '선택한 Agent로 프롬프트 실행'
- zh-TW: '已思考' / '使用指定 Agent 執行提示'

en/zh are unchanged. `tsc --noEmit` is now clean and the i18n + timestamp
suites pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@NanmiCoder NanmiCoder merged commit 4bea9ee into NanmiCoder:main Jun 4, 2026
1 check passed
@NanmiCoder
Copy link
Copy Markdown
Owner

我已经补了一些修复了,合并到main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:desktop enhancement New feature or request size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants