qml: list only translated languages in the language picker #1147

Open
uqlidi wants to merge 3 commits from language-coverage into qt6 AGit
uqlidi commented 2026-11-24 21:29:23 +00:00 (Migrated from github.com)

The language picker lists all ~100 bitcoin-qt translations, but the QML app only has a translation for Spanish. Picking any other language changes nothing.

This PR:

  • Lists only languages that have a bitcoin_qml_<tag>.qm, plus "System default".
  • Measures each translation's coverage at build time (cmake/script/TranslationCoverage.cmake) and shows "Partially translated (N%)" under any language below 90%.
  • Updates bitcoin_qml.ts and bitcoin_qml_es.ts to the current interface. The template had 522 strings; it now has 1,494.
Before After
image image
The language picker lists all ~100 bitcoin-qt translations, but the QML app only has a translation for Spanish. Picking any other language changes nothing. This PR: - Lists only languages that have a `bitcoin_qml_<tag>.qm`, plus "System default". - Measures each translation's coverage at build time (`cmake/script/TranslationCoverage.cmake`) and shows "Partially translated (N%)" under any language below 90%. - Updates `bitcoin_qml.ts` and `bitcoin_qml_es.ts` to the current interface. The template had 522 strings; it now has 1,494. | Before | After | |---|---| | <img width="1100" height="700" alt="image" src="https://git.fish.foo/attachments/4e9262aa-f75b-4057-a2aa-00ddef54f18c" /> | <img width="1100" height="700" alt="image" src="https://git.fish.foo/attachments/0692798a-cb66-43f6-8ed8-abd5ea8f8439" /> |
rreview commented 2026-11-24 22:07:39 +00:00 (Migrated from github.com)

🟠 Minor · The picker hides an active language without a QML catalog

A saved Core-only language such as de remains active and appears on Display, but the picker no longer represents it, marks no selection, and cannot restore it after the user switches away.

Location: qml/models/options_model.cpp:744 (head).

🔵 Suggestion · Coverage assertions exercise only missing-key fallbacks

Source inspection shows that availableLanguagesHaveAppTranslations() would still pass with empty or malformed translation_coverage.json, leaving generated percentages and the 90% cutoff unchecked.

Location: test/test_options_model.cpp:3433 (head).

Review coverage was incomplete.


Reviewed: b2ce6ac7dfea · Review report

<!-- ralph-major:bitcoin-core/gui-qml --> **🟠 Minor · The picker hides an active language without a QML catalog** A saved Core-only language such as `de` remains active and appears on Display, but the picker no longer represents it, marks no selection, and cannot restore it after the user switches away. Location: [qml/models/options_model.cpp:744](<https://github.com/bitcoin-core/gui-qml/blob/b2ce6ac7dfea6bdbf56a848527dbfc3c8bc3777a/qml/models/options_model.cpp#L744>) (head). **🔵 Suggestion · Coverage assertions exercise only missing-key fallbacks** Source inspection shows that `availableLanguagesHaveAppTranslations()` would still pass with empty or malformed `translation_coverage.json`, leaving generated percentages and the 90% cutoff unchecked. Location: [test/test_options_model.cpp:3433](<https://github.com/bitcoin-core/gui-qml/blob/b2ce6ac7dfea6bdbf56a848527dbfc3c8bc3777a/test/test_options_model.cpp#L3433>) (head). Review coverage was incomplete. <!-- Review tier: sensitive --> --- Reviewed: [`b2ce6ac7dfea`](<https://github.com/bitcoin-core/gui-qml/commit/b2ce6ac7dfea6bdbf56a848527dbfc3c8bc3777a>) · [Review report](<https://review.fish.foo/report/gui/1147-b2ce6ac7dfea6bdbf56a848527dbfc3c8bc3777a-3088-2.html>)
ValeraFinebits (Migrated from github.com) reviewed 2026-11-26 12:38:00 +00:00
ValeraFinebits (Migrated from github.com) left a comment

I tested this on Windows at b2ce6ac and noticed two things in Display settings.

  • Theme selection after changing the language. With Dark selected, I opened Display > Language and chose Español. The app stayed dark and the theme picker highlighted Claro (Light). I'd expect Oscuro (Dark) to stay selected. I also saw the reverse: with Oscuro correctly selected, switching back to System default highlighted Light while the app stayed dark.

  • Saved German after upgrading. I chose Deutsch in the base build, then opened the same profile with this PR. Display still showed Deutsch, and the saved setting still loaded German translations for some Bitcoin Core messages. In the language picker, Deutsch was missing and no language was marked as selected. After trying Español, I couldn't switch back to German. Could we show the saved language as selected and give users a way to return to it after trying another language?

I tested this on Windows at b2ce6ac and noticed two things in Display settings. - **Theme selection after changing the language.** With `Dark` selected, I opened Display > Language and chose `Español`. The app stayed dark and the theme picker highlighted `Claro` (Light). I'd expect `Oscuro` (Dark) to stay selected. I also saw the reverse: with `Oscuro` correctly selected, switching back to `System default` highlighted `Light` while the app stayed dark. - **Saved German after upgrading.** I chose `Deutsch` in the base build, then opened the same profile with this PR. Display still showed `Deutsch`, and the saved setting still loaded German translations for some Bitcoin Core messages. In the language picker, `Deutsch` was missing and no language was marked as selected. After trying `Español`, I couldn't switch back to German. Could we show the saved language as selected and give users a way to return to it after trying another language?
Sign in to join this conversation.
No description provided.