i18n: Italian translation of the BAL plugin (BAL follows Electrum's language) #8

Closed
bitcoinafterlife wants to merge 0 commits from feature/i18n into main

Translates the Qt GUI of the plugin, starting with Italian. Plan and decisions: PLAN_I18N.md.

How it works

  • New bal/i18n.py: BAL's own gettext catalog (domain "bal"), shipped in the zip. _() uses Electrum's translation first, then BAL's, then English. BAL follows the language chosen in Electrum (restart needed, like Electrum). The CLI stays English.
  • Italian catalog: bal/locale/it_IT/LC_MESSAGES/bal.po, 424 texts, reviewed by the owner. build_zip.py compiles it into the zip (needs Babel: pip install babel).

Safety

  • Stored data does not depend on the GUI language: the status history is saved in English and translated only for display; the history label and wallet labels are never translated (BAL uses them to recognise its own transactions).
  • tests/test_translations.py rejects translations that change {} fields or $tokens, or add addresses, e-mails or links.

Visible changes

  • With Electrum in Italian, BAL is in Italian; in English nothing changes except a double colon fixed in the will detail ("Transaction fees::", "Status::").

Verification

  • Electrum 4.8.2: 640 offline tests passed; the only failures are pre-existing on main (tests/karen7 wallet missing, test_import_start_stop_scan_signal_wiring). Ruff INT clean, no new errors. Zip tested by the owner on Windows.

Release note: the release machine needs Babel installed before running make-release.sh.
See CHANGELOG entries 58, 59, 60.

Translates the Qt GUI of the plugin, starting with Italian. Plan and decisions: PLAN_I18N.md. How it works - New bal/i18n.py: BAL's own gettext catalog (domain "bal"), shipped in the zip. _() uses Electrum's translation first, then BAL's, then English. BAL follows the language chosen in Electrum (restart needed, like Electrum). The CLI stays English. - Italian catalog: bal/locale/it_IT/LC_MESSAGES/bal.po, 424 texts, reviewed by the owner. build_zip.py compiles it into the zip (needs Babel: pip install babel). Safety - Stored data does not depend on the GUI language: the status history is saved in English and translated only for display; the history label and wallet labels are never translated (BAL uses them to recognise its own transactions). - tests/test_translations.py rejects translations that change {} fields or $tokens, or add addresses, e-mails or links. Visible changes - With Electrum in Italian, BAL is in Italian; in English nothing changes except a double colon fixed in the will detail ("Transaction fees::", "Status::"). Verification - Electrum 4.8.2: 640 offline tests passed; the only failures are pre-existing on main (tests/karen7 wallet missing, test_import_start_stop_scan_signal_wiring). Ruff INT clean, no new errors. Zip tested by the owner on Windows. Release note: the release machine needs Babel installed before running make-release.sh. See CHANGELOG entries 58, 59, 60.
bitcoinafterlife added 3 commits 2026-09-26 21:10:22 +00:00
Plan for translating the Qt GUI of the plugin into Italian via a
BAL-owned gettext catalog, with the owner's decisions recorded in
section 6. No code changes.
Phase 1: new bal/i18n.py, BAL's own gettext layer (domain "bal", catalogs
read with plugin.read_file()). _() asks Electrum's catalog first, then
BAL's, then returns the English source. The Qt plugin loads the catalog of
Electrum's GUI language at start-up; the CLI stays English.

Phase 2: every user-visible GUI text is now a whole, extractable sentence
(Ruff INT rules enabled). Class-level texts are marked with N_() and
translated when shown. Stored data stays language-neutral: the status
history is written in English and translated for display, the calendar
defaults follow the GUI language, and the history label and wallet labels
are never translated because BAL uses them to recognise its transactions.

No visible change apart from the double colon fixed in the will detail.
See CHANGELOG entries 58 and 59 and PLAN_I18N.md.
- babel.cfg and the catalog sources: bal/locale/bal.pot (424 texts) and
  bal/locale/it_IT/LC_MESSAGES/bal.po, fully translated (43 entries taken
  from Electrum's it_IT catalog, the rest following the owner's glossary
  and review: "locktime" kept in English, "transazione senza
  Will-Executor" for the backup transaction).
- build_zip.py compiles each bal.po into bal.mo inside the zip (Babel
  required); .po/.pot are not shipped and *.mo is ignored by git.
- tests/test_translations.py: catalogs compile, {} fields and $tokens
  match, no address/e-mail/URL added by a translation (patterns from
  electrum-locale).
- AGENTS.md: how to update the catalogs or add a language.

See CHANGELOG entry 60 and PLAN_I18N.md.
bitcoinafterlife requested review from svatantrya 2026-09-26 21:10:22 +00:00
svatantrya closed this pull request 2026-10-01 01:56:39 +00:00
svatantrya reopened this pull request 2026-10-01 03:12:53 +00:00
svatantrya closed this pull request 2026-10-01 20:35:20 +00:00

Pull request closed

Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bitcoinafterlife/bal-electrum-plugin#8