Add Chinese (Simplified & Traditional) UI, fix language detection and list operations bug - #1
Open
HarrisXiu wants to merge 3 commits into
Open
Add Chinese (Simplified & Traditional) UI, fix language detection and list operations bug#1HarrisXiu wants to merge 3 commits into
HarrisXiu wants to merge 3 commits into
Conversation
…d language switcher - Add zh_cn (Simplified Chinese) and zh_tw (Traditional Chinese) translations to I18N dict - Fix language detection bug: original code always set lang to 'en' regardless of system locale (Japanese data was never selected) - Auto-detect Chinese variants: zh_TW/zh_HK/zh_MO -> Traditional, zh_CN/zh_SG -> Simplified - Add Language menu (日本語 / English / 简体中文 / 繁體中文) with preference persisted in config - Add readme.zh-cn.md and readme.zh-tw.md, link all language READMEs
- Fix stale Treeview rows: update_output_preview now always refreshes the tree even when the file list is empty. Previously, clearing the list left ghost rows, and subsequent move/remove operations raised IndexError on stale selections (silently swallowed in --noconsole builds), making all list operations appear broken. - Replace remaining hardcoded Japanese UI strings with I18N lookups: page-number position fallback, CID/Helvetica font log messages, PPT conversion error log, overwrite-confirmation dialog, default range value, output-example label, range-editor window title - Recommend Chinese fonts (Microsoft YaHei / SimSun / PMingLiU) for zh UI - Localize default watermark template text per language - Add lbl_output_example key to all 4 languages (96 keys each, parity verified)
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.
The Japanese I18N data existed but was never selectable. Fixed to properly detect ja, plus Chinese variant detection:
zh_TW / zh_HK / zh_MO → Traditional Chinese
zh_CN / zh_SG → Simplified Chinese
3. Bug fix: list operations (move up/down, remove, clear) appeared broken
update_output_preview() returned early without refreshing the Treeview when the file list became empty. Clearing the list left ghost rows, and subsequent move/remove clicks raised IndexError on stale selections (silently swallowed in --noconsole builds), making all list operations appear broken.
Fix: always refresh the tree, even when the list is empty.
Replaced remaining hardcoded Japanese UI strings with I18N lookups:
Page-number position fallback, CID/Helvetica font log messages
PPT conversion error log, overwrite-confirmation dialog
Default range value, output-example label, range-editor window title
Also:
Recommend Chinese fonts (Microsoft YaHei / SimSun / PMingLiU) for zh UI
Localize default watermark template text per language
5. Language switcher menu
Added a Language menu in the menu bar: 日本語 / English / 简体中文 / 繁體中文
The user's choice is persisted in the config file and takes priority over system auto-detection
Switching prompts to restart the app to apply
6. Documentation
Added readme.zh-cn.md (Simplified) and readme.zh-tw.md (Traditional)
Linked all language READMEs at the top of the main README
Testing
python -m py_compile passes
I18N key parity verified across all 4 languages (96 keys each, no missing/extra)
Automated UI test: move up/down, remove, and clear list all update the Treeview correctly; tree is empty after clearing
GUI launches correctly; Language menu switches and persists preference