Skip to content

feat(i18n): add Traditional Chinese (zh-Hant) locale support#781

Closed
vincentredrock wants to merge 4 commits into
Hmbown:mainfrom
vincentredrock:feat/zh-hant-locale
Closed

feat(i18n): add Traditional Chinese (zh-Hant) locale support#781
vincentredrock wants to merge 4 commits into
Hmbown:mainfrom
vincentredrock:feat/zh-hant-locale

Conversation

@vincentredrock
Copy link
Copy Markdown

Summary

Adds full Traditional Chinese (zh-Hant) locale support to the TUI. Taiwanese/Macau/Hong Kong users can now auto-detect or manually select Traditional Chinese.

Changes

  • localization.rs: New Locale::ZhHant variant, chinese_traditional() translation function (~200 lines), parse_locale updated to map zh-TW/zh-HK/zh-MO to ZhHant
  • config_ui.rs: UiLocale enum extended with ZhHant
  • commands/config.rs: locale match added for ZhHant
  • settings.rs: locale validation & help text updated
  • onboarding/language.rs: zh-Hant option added (hotkey 5), pt-BR moved to 6
  • views/mod.rs: locale hint updated
  • widgets/mod.rs: composer test includes ZhHant

Closes #740

@vincentredrock vincentredrock force-pushed the feat/zh-hant-locale branch from f044b42 to d1c92ef Compare May 6, 2026 03:20
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds Traditional Chinese (zh-Hant) localization support, including comprehensive message translations, locale detection logic, and configuration updates. It also refines the UI theme by introducing a footer background color and adjusting section backgrounds. Feedback was provided regarding the formatting of multiline strings in the new translation file to ensure correct indentation in the TUI display.

Comment thread crates/tui/src/localization.rs Outdated
Comment on lines +1571 to +1572
"第 3 輪起命中率穩定在 ~70% 以上即表示前綴快取穩定;
長工作階段中明顯偏低則意味著前綴有抖動,值得排查(#263)。"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

In Rust, multiline string literals include the newline and all leading whitespace of subsequent lines. This will cause the second line of the CmdCacheAdvice message to be displayed with unintended indentation in the TUI. Use a backslash (\) at the end of the line to continue the string without including the source code's indentation, and explicitly include \n if a newline is desired, consistent with other multiline strings in this file.

            "第 3 輪起命中率穩定在 ~70% 以上即表示前綴快取穩定;\n\\\n             長工作階段中明顯偏低則意味著前綴有抖動,值得排查(#263)。"

@vincentredrock vincentredrock closed this by deleting the head repository May 9, 2026
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