Skip to content

Add Chinese (Simplified & Traditional) UI, fix language detection and list operations bug - #1

Open
HarrisXiu wants to merge 3 commits into
lemles:mainfrom
HarrisXiu:feature/chinese-i18n
Open

Add Chinese (Simplified & Traditional) UI, fix language detection and list operations bug#1
HarrisXiu wants to merge 3 commits into
lemles:mainfrom
HarrisXiu:feature/chinese-i18n

Conversation

@HarrisXiu

Copy link
Copy Markdown

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.

  1. Completed i18n coverage
    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

…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)
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.

1 participant