Skip to content

Speak Chinese: the window and the build guide - #18

Closed
652436962 wants to merge 1 commit into
medinstech:mainfrom
652436962:ui-zh-cn
Closed

652436962 wants to merge 1 commit into
medinstech:mainfrom
652436962:ui-zh-cn

Conversation

@652436962

Copy link
Copy Markdown
Contributor

What

Adds Simplified Chinese as a third language beside English and Turkish, for both the interface (--lang zh, a zh_CN locale, or Language ▸ 中文) and the build guide it writes.

How

  • ui/i18n_zh.py holds 3,045 interface entries and phrasebook_zh.py 462 guide templates, both keyed by the same English strings as the Turkish tables. They are separate modules so neither catalogue doubles the other file, and Chinese is a peer language: AVAILABLE, CATALOGUES and GUIDE_LANGUAGES include zh, and guide_language("zh_CN") returns zh.
  • The catalogue follows the Turkish one's rules: placeholders and format specs unchanged, backticked code and markup untouched, every accelerator kept (Qt matches the letter, the label shows 文件(&F)), Chinese punctuation and 您.
  • The guide writes its steps, checks, orientation notes and cut list in Chinese; the HTML page and the JSON export are tagged zh; the MCP generate_guide tool accepts "language": "zh" and still refuses one it cannot write.
  • The two words Turkish deliberately leaves untranslated (Net, Jumper) do have Chinese entries (网络, 跳线), so the settings search and the catalogue scan see them.

Tests

  • tests/test_i18n.py loops every catalogue for stale keys, coverage, same-as-key entries and per-menu accelerator clashes, and gains Chinese translation and locale tests.
  • tests/test_phrasebook.py checks the Chinese table in both directions, field and format equality, absence of markup, zh/zh_CN/zh-CN/ZH locale mapping, and builds the NE555 example in Chinese to prove it is the same build (steps, checks, cuts, BOM) with a Chinese page and a zh JSON tag.
  • README, README.tr, ARCHITECTURE, CHANGELOG and docs/MCP.md say three languages now.

Notes

The wording is a first pass: the mechanics (placeholders, accelerators, coverage) are enforced by the tests, and the terminology follows the glossary the Turkish catalogue established (perfboard 洞洞板, solder trace 焊锡走线, footprint 封装, …). A native-speaker review is welcome.

…beside the Turkish one (ui/i18n_zh.py, phrasebook_zh.py), chosen by --lang zh, a zh_CN locale or the Language menu, with the same placeholders and the same accelerators; the guide's language, its HTML and JSON tags and the MCP generate_guide tool take zh, and every catalogue test now runs once per language
@SinanTufekci

Copy link
Copy Markdown
Member

Thank you, @652436962! Both are on main for 0.26.0, with you as the author:

We land outside work by putting the commits on main ourselves rather than with the merge button, so this shows as closed, not merged; the commits are yours, and the CHANGELOG thanks you in both entries.

On top, in separate commits: the Chinese README names Chinese among the interface languages, a guide line of several clauses is joined with the Chinese comma, pinout cards measure and wrap Chinese as Chinese (the legend overlapped), the HTML guide is tagged zh-Hans, and the settings search and the engine's sentences are tested in all three catalogues.

One thing for Linux users: the AppImage carries no CJK font, so the window needs a system one (Noto Sans CJK or WenQuanYi). A native speaker's pass over the wording is very welcome, as you offered: a follow-up PR is the easiest way.

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.

2 participants