Page MenuHome GnuPG

Kleopatra: GnuPG System configuration not translated
Testing, NormalPublic

Description

Configure / GnuPG System is not translated:

  • en_US

  • ja

Details

Version
gpg4win-5.0.0-beta395 @ win11

Event Timeline

timegrid created this object with edit policy "Contributor (Project)".

For such language tickets please give more information. What are your language settings? Not only in Kleo, the system language settings, too.

You could also try to delete klanguageoverridesrc and check again.

This comment was removed by timegrid.

The screenshots were made with

  • ISO: EnglishInternational
  • Windows Language: English (United Kingdom) - note: i installed English (United States), but can't select it
  • Country or Region: German
  • Regional Format: German

The translation of GnuPG System in Kleopatra (as well as the output of gpg CLI) is in English after setting

  • Regional Format: English (United States)

So i guess, this is expected? Although a bit unexpected, as the "regional format" description says, it's about "numbers, currency, date and time"

I have no idea how Qt/KDE and how gettext (resp. gnupg's replacement of gettext for Windows) react to Windows's "regional format" setting. It seems that Qt/KDE correctly use English despite German regional format while gnupg uses German.

It's not clear from your comment whether gpg CLI also used German with the settings the screenshots were made with.
Edit: I guess https://dev.gnupg.org/T7886#207284 answers my question.

Notes to self:

  • On Windows, libgpg-error's gettext replacement uses the value of LC_ALL, LC_MESSAGE, or LANG (in this order) if set. Otherwise, it uses Windows's GetThreadLocale. (gnupg should probably use the MUI API instead.)
  • We should probably force Qt's/KDE's language on gnupg by setting LANG.

Right, gpg CLI output depends on it, too.

ikloecker mentioned this in Unknown Object (Maniphest Task).Nov 3 2025, 9:01 AM

The language settings of Windows have strange influence on Kleopatra and GnuPG.

Windows has:

  • The system language (of the installed Windows)
  • The Windows display language ("Windows features like Settings and File Explorer will appear in this language.")
  • The Preferred languages ("Apps and websites will appear in the first language in the list that they support.")
  • The Regional format ("Windows formats dates and times based on your language and regional preferences.")

Tested on a German system:

Windows display: en_US + Apps & websites: en_US(:de_DE) + Regional format: en_US -> both use en_US

GetUserPreferredUILanguages: QList("en-US")
QLocale(): QLocale(English, Latin, United States)
QLocale().uiLanguages(): QList("en-US", "en-Latn-US", "en")

Windows display: en_US + Apps & websites: de_DE(:en_US) + Regional format: en_US -> both use en_US

GetUserPreferredUILanguages: QList("en-US")
QLocale(): QLocale(English, Latin, United States)
QLocale().uiLanguages(): QList("en-US", "en-Latn-US", "en")

Windows display: en_US + Apps & websites: de_DE(:en_US) + Regional format: de_DE -> both use de_DE

GetUserPreferredUILanguages: QList("en-US")
QLocale(): QLocale(German, Latin, Germany)
QLocale().uiLanguages(): QList("de", "de-Latn-DE", "de-DE", "en-US", "en-Latn-US", "en")

Windows display: en_US + Apps & websites: en_US(:de_DE) + Regional format: de_DE -> both use de_DE

GetUserPreferredUILanguages: QList("en-US")
QLocale(): QLocale(German, Latin, Germany)
QLocale().uiLanguages(): QList("de", "de-Latn-DE", "de-DE", "en-US", "en-Latn-US", "en")

Windows display: de_DE + Apps & websites: de_DE(:en_US) + Regional format: de_DE -> both use de_DE

GetUserPreferredUILanguages: QList("de-DE", "en-US")
QLocale(): QLocale(German, Latin, Germany)
QLocale().uiLanguages(): QList("de-DE", "de-Latn-DE", "de", "en-US", "en-Latn-US", "en")

Windows display: de_DE + Apps & websites: en_US(:de_DE) + Regional format: de_DE -> both use de_DE

QLocale(): QLocale(German, Latin, Germany)
QLocale().uiLanguages(): QList("de-DE", "de-Latn-DE", "de", "en-US", "en-Latn-US", "en")

Windows display: de_DE + Apps & websites: en_US(:de_DE) + Regional format: en_US -> Kleo de_DE , GnuPG en_US
Windows display: de_DE + Apps & websites: de_DE(:en_US) + Regional format: en_US -> Kleo de_DE , GnuPG en_US

GetUserPreferredUILanguages: QList("de-DE", "en-US")
QLocale(): QLocale(English, Latin, United States)
QLocale().uiLanguages(): QList("de-DE", "de-Latn-DE", "de", "en-US", "en-Latn-US", "en")

Conclusions:

  • GetUserPreferredUILanguages
    • always returns the Windows display language as first language regardless of Regional format and Preferred languages; this makes sense if one accepts that Preferred languages is not considered by GetUserPreferredUILanguages (which seems to agree with the API documentation)
    • returns only "en-US" if Windows display language is en-US, but returns "de-DE, en-US" if Windows display language is de-DE; this doesn't make sense to me, but that's Windows; the internet supports this observation: it seems that en-US is always returned as "fallback" if the Windows display language isn't already en-US
  • Preferred languages (aka Apps & websites) seems to be completely ignored by Kleo and GnuPG; this isn't surprising since GetUserPreferredUILanguages also ignores it
  • GnuPG seems to prefer the Regional format; this is because libgpg-error uses GetThreadLocale as mentioned above
  • Kleo behaves strange:
    • If system lang and display lang are both de_DE then Regional format doesn't matter
    • If system lang and display lang are different then Regional format is preferred
  • QLocale prefers Regional format (which makes sense since locale is more about numbers, dates, etc., than about languages)
  • QLocale().uiLanguages() behaves as strange as Kleo; in fact, they behave exactly the same way, i.e. Kleo uses the first language in the list returned by QLocale().uiLanguages(); it's pretty obvious to me that QLocale().uiLanguages() is wrong/broken
ebo triaged this task as Normal priority.Nov 5 2025, 10:05 AM
ikloecker changed the task status from Open to Testing.Nov 5 2025, 1:50 PM
ikloecker moved this task from Backlog to WIP on the gpd5x board.

Fixed. Kleopatra and the GnuPG System configuration and error messages coming from GnuPG should now always use the configured Windows display language regardless of the Preferred languages or the Regional format. (GnuPG on the command line will still use the Regional format.)

If a different language is configured directly in Kleopatra then this language should be used for everything in Kleopatra. But this functionality should be removed from Kleopatra by deactivating the switch_application_language action. This needs to be done for the special customized VSD and GPD builds.

ikloecker mentioned this in Unknown Object (Maniphest Task).Mon, Nov 10, 9:01 AM
timegrid changed the task status from Testing to Open.Fri, Nov 21, 1:25 PM

Tested on gpg4win-5.0.0-beta413 @ win11

Done:

  • Switching the Windows display language (Kleopatra: default langauge) results in both Kleopatra and GnuPG System Tab being translated to this language

Issues found:

  • The initial language in kleopatra is not selected according to windows settings, e.g.
    • Settings
      • Windows display language: English
      • Country or region: Germany
      • Regional format: German
    • Result
      • In the Kleopatra language dialog
        • German is initially selected and clicking OK does not generate a klanguageoverridesrc file, so German can't be selected without selecting another language first
        • Selecting German after the klanguageoverridesrc was generated will display both Kleopatra and Gnupg System Tab in German (ok)
  • Wrong language in GnuPG error messages
    • Settings
      • Windows display language: English
      • Country or region: Germany
      • Regional format: German
      • Kleopatra: default (no override) or English
    • Result
      • GnuPG error messages are in German (although diagnostics are in English), e.g.
        • setting a wrong default-new-key-adsk:
        • decrypting an invalid file:

Please create a separate ticket for "The initial language in kleopatra is not selected according to windows settings". This is a bug in KDE Frameworks that's orthogonal to the issues of this ticket.

Actually, Werner wants the possibility to change the language in Kleopatra (or Okular) to be removed from Gpg4win/VSD which would make this issue irrelevant for us.

Separate ticket for the "initial language selection": https://dev.gnupg.org/T7949

ikloecker mentioned this in Unknown Object (Maniphest Task).Mon, Dec 1, 8:46 AM
ikloecker changed the task status from Open to Testing.Tue, Dec 2, 3:08 PM

The remaining issue "Wrong language in GnuPG error messages" is now also fixed. Until there's a new version of libgpg-error I've added the changes as patches.