Files
purple-electrumwallet/electrum
SomberNight 3afa2fcdf3 locale: gui: show translation completion percentage in language names
In the GUIs, on the language-select screen, show e.g.
  Czech (100%), Danish (13%), Dutch (54%)
instead of
  Czech, Danish, Dutch

- we count the source strings when creating the .pot PO-template file
  and add an "X-Electrum-SourceStringCount" header to it, in the push_locale.py script that uploads the .pot file to crowdin.
  - later, when we run electrum-locale/update.py to download the translations in .po files, these files will also contain the same header.
  - then when the build_locale.sh script compiles those .po files, we can read the header and use it to populate a new "stats.json" file
    that we place in electrum/locale/locale/ and bundle in the all release binaries/distributables.
    - stats.json also includes the number of translated strings for each lang
- at runtime we simply read stats.json and use the values to calculate the percentages
  - a prior implementation did not pre-calc stats.json but did all calculations at runtime (by opening all .mo translations)
    - however that was deemed to slow, hence the build-time pre-calc
      - runtime calc took 40 ms on my laptop, so I guess it could easily take 10x that on an old phone
- just as we have always been very tolerant of any locale files or even the whole locale/ dir missing, we also tolerate stats.json missing
2026-02-21 03:40:09 +00:00
..
2026-01-22 14:02:19 +01:00
2022-07-07 18:29:01 +02:00
2022-10-20 18:43:54 +00:00
2026-02-17 18:11:13 +00:00
2025-08-18 15:38:25 +00:00
2025-12-02 10:38:10 +01:00
2026-01-28 17:49:36 +01:00
2025-12-17 10:23:16 +00:00
2025-08-08 14:34:53 +00:00
2024-11-29 17:09:29 +08:00
2026-01-22 16:22:42 +01:00