feat(i18n): add Traditional Chinese (zh-Hant) locale support#781
feat(i18n): add Traditional Chinese (zh-Hant) locale support#781vincentredrock wants to merge 4 commits into
Conversation
f044b42 to
d1c92ef
Compare
There was a problem hiding this comment.
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.
| "第 3 輪起命中率穩定在 ~70% 以上即表示前綴快取穩定; | ||
| 長工作階段中明顯偏低則意味著前綴有抖動,值得排查(#263)。" |
There was a problem hiding this comment.
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)。"
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
Locale::ZhHantvariant,chinese_traditional()translation function (~200 lines),parse_localeupdated to mapzh-TW/zh-HK/zh-MO toZhHantUiLocaleenum extended withZhHantZhHantZhHantCloses #740