Skip to content

fix(i18n): tray menu shows Simplified Chinese when Traditional Chinese is selected#901

Merged
cjpais merged 2 commits intocjpais:mainfrom
parkghost:fix/tray-zh-tw-locale-v2
Mar 1, 2026
Merged

fix(i18n): tray menu shows Simplified Chinese when Traditional Chinese is selected#901
cjpais merged 2 commits intocjpais:mainfrom
parkghost:fix/tray-zh-tw-locale-v2

Conversation

@parkghost
Copy link
Copy Markdown
Contributor

Before Submitting This PR

Human Written Description

PR #796 added Traditional Chinese (zh-TW) locale support and fixed locale truncation in
settings.rs and i18n/index.ts, but missed the same truncation bug in the Rust tray
menu code (tray_i18n.rs). When a user selects 繁體中文 (Traditional Chinese), the tray menu still shows
Simplified Chinese text (e.g. "设置..." instead of "設定...") because get_language_code()
strips "zh-TW" down to "zh", which maps to Simplified Chinese.

Related Issues/Discussions

Follow-up fix for #796

Testing

  1. Build and launch Handy
  2. Set app language to 繁體中文 (Traditional Chinese)
  3. Right-click the system tray icon
  4. Before fix: menu shows 簡體中文 (设置..., 检查更新..., 退出)
  5. After fix: menu shows 繁體中文 (設定..., 檢查更新..., 結束)

AI Assistance

  • AI was used (please describe below)

If AI was used:

  • Tools used: Claude Code
  • How extensively: Identified the root cause and wrote the one-file fix

parkghost and others added 2 commits February 26, 2026 04:30
…e is selected

The tray locale lookup truncated "zh-TW" to "zh", always hitting
Simplified Chinese. Now tries full locale first, then language prefix,
then English.

Follow-up fix for cjpais#796.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@cjpais
Copy link
Copy Markdown
Owner

cjpais commented Mar 1, 2026

Thank you!

@cjpais cjpais merged commit 2361b85 into cjpais:main Mar 1, 2026
4 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.

2 participants