Add Simplified Chinese localization#46
Open
Starkxim wants to merge 1 commit into
Open
Conversation
Add a Simplified Chinese (zh-CN) translation alongside the existing Traditional Chinese, wired into the language enum, menu, settings code, and persistence. Map zh-CN, zh-SG, zh-Hans, and bare "zh" to Simplified Chinese in from_code, and route zh-MO to Traditional Chinese so Macau is no longer treated as Simplified. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Simplified Chinese (
zh-CN) translation alongside the existing Traditional Chinese, so mainland China / Singapore / Hans-script users get a native UI instead of falling back to English.Changes
src/localization/simplified_chinese.rswith the fullStringstable and the WinGet update label, using mainland conventions (刷新, 设置, 默认, 退出, 小组件, 应用程序, …).SimplifiedChineseinLanguageId— enum,ALL,code()→zh-CN,native_name()→ 简体中文,strings(), and the WinGet label — and wired up the menu item plus command handling inwindow.rs.from_code()now mapszh-CN,zh-SG,zh-Hans, and barezhto Simplified Chinese, and additionally routeszh-MO(Macau) to Traditional Chinese.The Simplified entry sits right after Traditional in the language menu so the two Chinese variants stay grouped together.
Testing
cargo build/cargo build --release— cleancargo fmt --check— cleancargo clippy— no new warnings