Skip to content

Add French, Chinese and Japanese localization with Windows language detection - #188

Open
TiagoFerreiraDomingues wants to merge 10 commits into
HeyOkay:mainfrom
TiagoFerreiraDomingues:teeti/french-localization
Open

TiagoFerreiraDomingues wants to merge 10 commits into
HeyOkay:mainfrom
TiagoFerreiraDomingues:teeti/french-localization

Conversation

@TiagoFerreiraDomingues

@TiagoFerreiraDomingues TiagoFerreiraDomingues commented Oct 2, 2026 •

Copy link
Copy Markdown

Halo Battery currently renders application text in English only. This adds French, Traditional Chinese, Simplified Chinese and Japanese localization, with English as the default and fallback.

Preferences offers English / Français / 繁體中文 / 简体中文 / 日本語. Selecting a language saves it and immediately updates tray menus and tooltips without polling hardware. On first startup without a saved preference (including older configurations), the app detects the user's Windows UI language and saves the matching supported language, or English otherwise. A saved choice always takes precedence; an invalid stored value falls back to English without redetection.

Addresses #162. The Asian catalogs incorporate miguotw's contribution.

Implementation

  • Adds 145 message keys in five statically imported Python catalogs. One registry supplies native names, catalogs, Windows language IDs and plural rules; no additional runtime dependencies or translation compilation step.
  • Uses primary Windows language IDs for regional variants and exact IDs to distinguish Traditional and Simplified Chinese. Failed detection and non-Windows environments use English.
  • Localizes classic/Fluent menus, preferences, tooltips, dynamic device states, estimates, notifications, rename dialogs, startup warnings and the What's new window's controls, headings and dates. French icon colour options use “Clair / Sombre”.
  • Keeps language-independent provider presentation metadata separate from English approx values. Hardware/custom names, identifiers, protocols, logs, diagnostics, history exports, --probe and status-file text retain their technical contracts.
  • Renders deferred notifications in the current language at delivery, preserving deduplication and cancellation. Immediate language changes use the existing application lock and do not manipulate Tk windows from application threads.
  • Uses localized Windows Forms text in the existing PowerShell rename process, transported through environment variables; preserves cancellation, Unicode and the 60-character limit. Tooltips respect Win32's UTF-16 buffer limit.
  • Includes upstream 1.15.0 (40a3a08) and subsequent main fixes/layout cleanup through 2251f05. Localizes the update installer, download progress, manual checks, keep-disconnected preference, NZXT/Steam family labels and new coarse/pending device states. The HyperX family label reflects Cloud II Core support; hardware names remain unchanged.
  • Follows the repository's new halo/ module layout. Updates README, docs/features.md, .github/CONTRIBUTING.md and the Unreleased changelog, including portable-mode language persistence.

Validation

Latest integration commit: 6d16e6d31f92ffeaca9770549250707f0cbc1f13 (upstream main merged without rewriting the published branch).

  • python -m unittest discover -s tests: 845 tests passed on Windows / Python 3.12.10. The sandbox denied fixture temporary-directory access, so the successful run used the normal Windows environment with isolated APPDATA.
  • Catalog checks cover all five languages' 145 keys, named parameters and plural forms. Provider-menu coverage checks the English reference keys and every language.
  • New tests cover localized update offers/progress, manual success/error replies, messages held until game exit, localized dates/headings, passing the language to the Tk thread, retained presentation metadata and Bluetooth coarse states. Existing updater tests retain their fake download/install/rollback checks.
  • Three additional local integration checks passed for initialization/manual precedence, immediate multiple-icon refresh, deferred notifications and language-independent technical status.
  • Python compilation and git diff --check passed.
  • Existing --onedir --windowed --noupx PyInstaller build succeeded (PyInstaller 6.22.3). Archive inspection confirmed five 145-message catalogs, the halo package, NZXT/Steam providers, Python 3.12 and Tcl/Tk.
  • Source and frozen --probe exited with code 0 using isolated settings; the frozen probe did not create a language configuration.
  • Native Win32 preferences labels were read back in all five languages. Real Windows-font layout/wrapping checks covered 140 Tk panels at 100%, 125%, 150% and 200% scaling. What's new footer link/button widths fit at these scales in all five languages.

Validation limits

The updated 1.15 build still needs full manual tray/dialog validation, native-speaker review of newly added Asian-language strings, and testing on the new physical hardware. Automatic updates were tested with fake downloads/installations; no live update of a user's installed copy was performed. Earlier manual testing described in the previous comments applies to the earlier build.

Published GitHub release-note prose remains in its original language; the What's new controls, known section headings and dates are localized. The window captures the selected language when it opens. Right-to-left layout is not implemented.

Related open PRs

Checked October 13, 2026. #249 — Language selection is a competing English/Spanish localization implementation (lang.py, 75 keys, its own menu/tooltip/notification/rename changes). It overlaps this PR's localization architecture and should be coordinated before either is merged; its code is not included here. #187 changes a per-device alert label; #253 changes Logitech identity/cache behavior; new-provider PRs need catalog keys and should preserve presentation metadata. #223 separately changes history estimate wording, which should also be reflected in the localized renderer if merged.

Shared filenames below do not establish conflicting hunks.

Shared files with 25 open PRs
  • #211: halo_battery.pyw
  • #254: CHANGELOG.md, providers/audeze.py, tests/test_audeze_stuck.py
  • #208: CHANGELOG.md, README.md, halo_battery.pyw
  • #169: CHANGELOG.md
  • #200: CHANGELOG.md, halo_battery.pyw
  • #246: CHANGELOG.md, README.md, halo_battery.pyw
  • #215: CHANGELOG.md, halo_battery.pyw
  • #216: CHANGELOG.md, README.md, providers/xinput.py, tests/test_xinput.py, tests/test_xinput_wired.py
  • #176: CHANGELOG.md, README.md, halo_battery.pyw
  • #181: CHANGELOG.md, README.md, halo_battery.pyw
  • #194: CHANGELOG.md, halo_battery.pyw
  • #207: CHANGELOG.md, halo_battery.pyw
  • #253: CHANGELOG.md, providers/logitech.py, tests/test_logitech.py
  • #250: CHANGELOG.md, halo_battery.pyw, providers/base.py
  • #249: CHANGELOG.md, halo_battery.pyw, tests/test_hide_rename.py
  • #248: CHANGELOG.md, README.md, halo_battery.pyw
  • #203: CHANGELOG.md
  • #205: CHANGELOG.md, providers/asus.py, tests/test_asus.py
  • #213: CHANGELOG.md
  • #158: CHANGELOG.md
  • #198: CHANGELOG.md
  • #187: CHANGELOG.md, README.md, halo_battery.pyw, tests/test_hide_rename.py
  • #212: CHANGELOG.md, README.md, halo_battery.pyw
  • #185: CHANGELOG.md, README.md, halo_battery.pyw, providers/asus.py, tests/test_asus.py
  • #182: CHANGELOG.md, README.md

Add Traditional Chinese, Simplified Chinese and Japanese localization
@TiagoFerreiraDomingues

Copy link
Copy Markdown
Author

Validation update after merging the Traditional Chinese, Simplified Chinese and Japanese translations:

  • All 502 project tests and 3 additional integration checks passed.
  • The Windows distribution was built successfully with Python 3.12.10. All five language catalogs and Tcl/Tk were verified in the bundle.
  • The frozen --probe completed successfully.
  • The resulting executable was manually tested on Windows; no issues were observed.

@TiagoFerreiraDomingues TiagoFerreiraDomingues changed the title Add French localization with Windows language detection Add French, Chinese and Japanese localization with Windows language detection Oct 7, 2026

Copy link
Copy Markdown
Author

Updated this PR for Halo Battery 1.14.0 in commit b8d20ac.

  • Localized the new low-battery sound preference in all five languages.
  • Added the three new device-family label keys, preserving hardware names. Each catalog now contains 109 messages.
  • Added coverage for the sound preference's persistence and all registered provider menus. The Bluetooth timing test now isolates real desktop full-screen detection; application polling behavior is unchanged.
  • 642 project tests passed with Python 3.12.10, plus three additional local integration checks.
  • The Windows 1.14 distribution built successfully; catalogs, new providers and Tcl/Tk were verified in the bundle. Source and frozen --probe passed.
  • Native preferences labels and font/layout measurements passed for all five languages at 100%, 125%, 150% and 200% scaling.

The PR title and description now reflect the five languages and current validation. The earlier manual test reported above applies to the previous build; full tray-mode manual validation of this updated 1.14 build remains pending.

Copy link
Copy Markdown
Author

Updated this PR for 1.15.0 and the latest upstream main in 6d16e6d.

  • Resolved the merge across the new halo/ module layout, updater and provider changes, preserving upstream behavior and English technical output.
  • All five catalogs now have 145 entries: update installation/progress and manual-check notifications, the keep-disconnected preference, NZXT/Steam labels, What's new controls/headings/dates, and the new Bluetooth/HID++ 1.0/pending state metadata.
  • 845 project tests passed with Python 3.12.10, plus three local integration checks. Compilation and whitespace checks passed.
  • The Windows 1.15 build succeeded; catalogs, the new module layout, providers and Tcl/Tk were verified in the bundle. Source and frozen --probe passed.
  • Native labels and Windows-font layout checks passed in all five languages at 100%, 125%, 150% and 200% scaling, including the What's new footer.

Full manual validation of this new build and a live automatic update remain untested. Published release-note prose remains in its original language.

The description is updated accordingly. It now also flags #249 (Language selection) as a competing English/Spanish localization architecture requiring coordination; it is not part of this contribution.

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