Skip to content

Add a Chinese / English language setting; English README by default - #10

Merged
txp666 merged 3 commits into
mainfrom
i18n
Nov 4, 2026
Merged

txp666 merged 3 commits into
mainfrom
i18n

Conversation

@txp666

@txp666 txp666 commented Nov 4, 2026

Copy link
Copy Markdown
Owner
  • The settings page has 语言: 跟随系统 / 简体中文 / English, applied after a restart (the card and an InfoBar say so). 跟随系统 reads the system's first preferred UI language. The Fluent library's own texts follow it.
  • Source texts stay Chinese and go through tr(). English comes from one table, en.json (732 entries), byte-identical in PyQt UI Designer and FluentHMI Studio, so the same UI text reads the same in both apps. Placeholders are Qt-style %1 in both.
  • .uidp values that are Chinese (主站/从站, 保持寄存器, 文本, …) never change in files; combo boxes keep the value as item data and only show it translated. Loading never depends on the language; widgets added from the palette get their default texts in the interface language.
  • Exported apps use the language set at export time, like the theme; 跟随系统 stays 跟随系统 and follows the target system.
  • The update dialog shows only the matching half of the bilingual release notes (split at ## English).
  • tools/check_i18n.py (same file in both repos, run by the tests) fails on Chinese outside tr() or a text without English.
  • The Modbus slave log is built from translated pieces; the shared vectors in tests/data/modbus_slave_vectors.json are unchanged and still pass, since tests run untranslated.
  • README.md is now the English README and README_zh.md the Chinese one, each linking to the other.

Both test suites pass. The designer, its preview and the settings page were checked in English and Chinese, light and dark, with tutorial 02 loaded.

PyQt specifics: runtime module app/core/i18n.py (also copied into exports, which get an i18n.py holding only the strings they use; demo/ regenerated), the existing cfg.language item now has a card, and en.json is included in Nuitka builds.

🤖 Generated with Claude Code

txp666 and others added 3 commits November 4, 2026 18:21
The settings page has 语言 (跟随系统 / 简体中文 / English), applied after a restart.
Source texts stay Chinese and go through tr(); English comes from
app/resource/i18n/en.json, the same table FluentHMI Studio uses.
.uidp values keep their Chinese and are only shown translated. Exported
apps take the language set at export time, like the theme.
tools/check_i18n.py, run by the tests, keeps every text translatable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
README.md is now English and README_zh.md Chinese, each linking to the other.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Exports follow the designer's language setting, which is 跟随系统 by
default, so on an English CI runner the exported apps came out English
while the tests check Chinese texts. Every test export now passes
language="zh_CN", as test_demo already did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@txp666
txp666 merged commit 05865c0 into main Nov 4, 2026
6 checks passed
@txp666
txp666 deleted the i18n branch November 4, 2026 11:01
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