Skip to content

feat(i18n): add Traditional Chinese (zh-TW) locale support#120

Open
sk5s wants to merge 6 commits intoamicalhq:mainfrom
gopenso:create-zh-TW-locale
Open

feat(i18n): add Traditional Chinese (zh-TW) locale support#120
sk5s wants to merge 6 commits intoamicalhq:mainfrom
gopenso:create-zh-TW-locale

Conversation

@sk5s
Copy link

@sk5s sk5s commented Mar 12, 2026

Summary

This pull request introduces Traditional Chinese (zh-TW) localization to Amical, expanding the application's accessibility for Traditional Chinese-speaking users.

Changes Included

  • New Locale Files: Added translation files/dictionaries specifically for the zh-TW locale.
  • UI Translation: Translated core user interface strings, prompts, and settings into Traditional Chinese.
  • i18n Configuration: Updated the internationalization configuration to register zh-TW as an active and selectable language option within the application.
  • Language Selector: Ensured the new locale is correctly surfaced in the app's language selection menu.
image

Summary by CodeRabbit

  • New Features
    • Added Traditional Chinese (繁體中文) as a selectable language across the desktop app with a complete localization.
    • Settings → Preferences now includes the Traditional Chinese option.
    • Locale resolution improved so regional Chinese variants (e.g., zh, zh-HK, zh-MO, zh-Hant) map to Traditional Chinese where appropriate.

@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8d2adcd0-1427-43db-9a5a-739aa3e52f3e

📥 Commits

Reviewing files that changed from the base of the PR and between ca425b1 and 2b28783.

📒 Files selected for processing (1)
  • apps/desktop/src/i18n/locales/zh-TW.json

📝 Walkthrough

Walkthrough

Adds Traditional Chinese (zh-TW) localization: new zh-TW.json, registers zh-TW in i18n resources and resolution logic, updates existing locale files to list zh-TW, and exposes zh-TW in the preferences language dropdown.

Changes

Cohort / File(s) Summary
Locale Option Updates
apps/desktop/src/i18n/locales/en.json, apps/desktop/src/i18n/locales/es.json, apps/desktop/src/i18n/locales/ja.json
Insert "zh-TW": "繁體中文" into language selection lists (minor JSON edits, trailing-comma adjustments).
New Traditional Chinese Locale
apps/desktop/src/i18n/locales/zh-TW.json
Adds complete Traditional Chinese translation file (~960+ strings) covering UI, onboarding, settings, widgets, errors, updater, model management, toasts, and dialogs.
i18n Integration
apps/desktop/src/i18n/shared.ts
Registers zh-TW in resources and supportedLocales; extends resolveLocale to map zh, zh-HK, zh-MO, and zh-Hant* variants to zh-TW.
Preferences UI
apps/desktop/src/renderer/main/pages/settings/preferences/index.tsx
Adds zh-TW as a selectable language option in the preferences language dropdown.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • amadeus-x1

Poem

🐰 I nibble keys and hop with cheer,
Zh‑TW strings now blooming here,
Characters curl in tidy rows,
Short hops bring long reading flows,
Hooray — translations snug and near! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: adding Traditional Chinese (zh-TW) locale support to the application's internationalization system.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

You can customize the high-level summary generated by CodeRabbit.

Configure the reviews.high_level_summary_instructions setting to provide custom instructions for generating the high-level summary.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/desktop/src/i18n/locales/zh-TW.json`:
- Around line 561-569: The "actions" object in the zh-TW locale is missing the
settings.history.actions.reportDisabledTelemetry key, causing fallback to
English; add a "reportDisabledTelemetry" entry to the existing "actions" block
with an appropriate Traditional Chinese string (e.g., "回報遙測已停用") so the key
settings.history.actions.reportDisabledTelemetry is present in the zh-TW locale
and mirrors the other locales.

In `@apps/desktop/src/i18n/shared.ts`:
- Around line 42-44: The current branch in resolveLocale that checks if base ===
"zh" incorrectly maps every zh-* to "zh-TW"; change the condition to only match
explicit Traditional-Chinese variants (e.g., check for full locale values or
script like "zh-TW", "zh-HK", "zh-MO", or "zh-Hant") instead of using the base
variable alone, so that Simplified variants such as "zh-CN", "zh-SG", or
"zh-Hans" are not coerced and will fall through to the normal supported-locale
matching or default fallback.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 87292c7a-c1fa-402c-96cf-7c8be9d00334

📥 Commits

Reviewing files that changed from the base of the PR and between 1944900 and 2f2856d.

📒 Files selected for processing (6)
  • apps/desktop/src/i18n/locales/en.json
  • apps/desktop/src/i18n/locales/es.json
  • apps/desktop/src/i18n/locales/ja.json
  • apps/desktop/src/i18n/locales/zh-TW.json
  • apps/desktop/src/i18n/shared.ts
  • apps/desktop/src/renderer/main/pages/settings/preferences/index.tsx

Extend locale resolution to map zh, zh-HK, zh-MO and zh-Hant* to zh‑TW.
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/desktop/src/i18n/locales/zh-TW.json`:
- Around line 347-350: The nav label "shortcuts.title" is inconsistent with the
page title; update the value of the "shortcuts.title" key in zh-TW locale to
"快捷鍵" so it matches the page title (leave "shortcuts.description" unchanged).
- Around line 372-377: The logoAlt value in the zh-TW locale is still English;
update the "logoAlt" key inside the "sidebar" object to a Traditional Chinese
label (e.g., "Amical 標誌" or "Amical 徽標") so screen readers announce a localized
alt text; ensure you only change the "logoAlt" string and keep other keys like
"brand" unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a7027b69-9c4f-4aa3-863f-b9fc3eb2ceb9

📥 Commits

Reviewing files that changed from the base of the PR and between 2f2856d and ca425b1.

📒 Files selected for processing (2)
  • apps/desktop/src/i18n/locales/zh-TW.json
  • apps/desktop/src/i18n/shared.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/desktop/src/i18n/shared.ts

@haritabh-z01
Copy link
Contributor

@sk5s Thanks for this.

Change shortcuts title to “快捷鍵” and logo alt text to “Amical 標誌”.
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