Kleopatra: Specify and implement language dependent configuration consistently
Testing, NormalPublic

Assigned To
Authored By
timegrid
Oct 5 2026, 2:56 PM

Description

The behavior of language dependent kleopatrarc configuration changed in vsd 3.4.0, probably due to

Until now we used de_DE/en_US to override language strings, e.g.

[CertificateCreationWizard]
CN_hint[de_DE][$i]='Vorname Nachname' eingeben.
CN_hint[en_US][$i]=Enter 'Firstname Lastname'.

Either we need to adjust shipped custom configuration files to use de/en instead, or adjust the behavior again.

Behaviour in vsd 3.3.7

de_DE/en_US:

  • depends only on Windows App Language
  • Windows App Language English (United States) and
    • Kleopatra Language on default: displayed in correct language (en)
    • Kleopatra Language on American English (en_US): displayed in correct language (en)
    • Kleopatra Language on English (UK) (en_GB): displayed in correct language (en)
    • Kleopatra Language on Deutsch (de): displayed in wrong language (en)
  • Windows App Language on Deutsch (Deutschland) and
    • Kleopatra Language on default: displayed in correct language (de)
    • Kleopatra Language on American English (en_US): displayed in wrong language (de)
    • Kleopatra Language on English (UK) (en_GB): displayed in wrong language (de)
    • Kleopatra Language on Deutsch (de): displayed in correct language (de)
  • Windows App Language English (UK) and
    • Kleopatra Language on default: nothing displayed
    • Kleopatra Language on American English (en_US): nothing displayed
    • Kleopatra Language on English (UK) (en_GB): nothing displayed
    • Kleopatra Language on Deutsch (de): nothing displayed

Note: If adjusted in the user kleopatrarc, [de] was rewritten to [de_DE], when Kleopatra was closed.

Behaviour in vsd 3.4.0

de_DE/en_US:

  • depends on Windows Display Language and Kleopatra Language (but de_DE does not match with de, en_US does not match with en_GB)
  • Windows Display Language English (United States) and
    • Kleopatra Language on default: displayed in correct language (en)
    • Kleopatra Language on American English (en_US): displayed in correct language (en)
    • Kleopatra Language on English (UK) (en_GB): nothing displayed
    • Kleopatra Language on Deutsch (de): nothing displayed
  • Windows Display Language on Deutsch (Deutschland) and
    • Kleopatra Language on default: displayed in correct language (de)
    • Kleopatra Language on American English (en_US): displayed in correct language (en)
    • Kleopatra Language on English (UK) (en_GB): nothing displayed
    • Kleopatra Language on Deutsch (de): nothing displayed
  • Windows Display Language English (UK) and
    • Kleopatra Language on default: nothing displayed
    • Kleopatra Language on American English (en_US): displayed in correct language (en)
    • Kleopatra Language on English (UK) (en_GB): nothing displayed
    • Kleopatra Language on Deutsch (de): nothing displayed

de/en:

  • depends on Windows Display Language and Kleopatra Language (works as expected)
  • Windows Display Language English (United States) and
    • Kleopatra Language on default: displayed in correct language (en)
    • Kleopatra Language on American English (en_US): displayed in correct language (en)
    • Kleopatra Language on English (UK) (en_GB): displayed in correct language (en)
    • Kleopatra Language on Deutsch (de): displayed in correct language (de)
  • Windows Display Language on Deutsch (Deutschland) and
    • Kleopatra Language on default: displayed in correct language (de)
    • Kleopatra Language on American English (en_US): displayed in correct language (en)
    • Kleopatra Language on English (UK) (en_GB): displayed in correct language (en)
    • Kleopatra Language on Deutsch (de): displayed in correct language (de)
  • Windows Display Language English (UK) and
    • Kleopatra Language on default: displayed in correct language (en)
    • Kleopatra Language on American English (en_US): displayed in correct language (en)
    • Kleopatra Language on English (UK) (en_GB): displayed in correct language (en)
    • Kleopatra Language on Deutsch (de): displayed in correct language (de)

Note: If adjusted in the user kleopatrarc, [de] was rewritten to [de_DE], when Kleopatra was closed - but i think, only if the Windows Display Language was set to Deutsch (Deutschland) (?).


Conclusion:

  • It would be a good idea to change the custom configuration to de/en (which works as one would expect it)
  • The rewrite of [de] -> [de_DE] in the user kleopatrarc would be a problem then and needs to be addressed
  • en_US not matching with en_GB is probably not a bug
  • But de_DE not matching with de might still be a bug?

Details

Version
vsd-3.4.0 @ win10

Event Timeline

timegrid created this object with edit policy "Contributor (Project)".
• ebo triaged this task as Normal priority.Oct 6 2026, 10:59 AM
• ebo added a project: Bug Report.

Conclusion:

  • It would be a good idea to change the custom configuration to de/en (which works as one would expect it)

Yes.

  • The rewrite of [de] -> [de_DE] in the user kleopatrarc would be a problem then and needs to be addressed

I'll have a look, but this isn't a problem with customization via the registry (which is how this should be used with VSD). [added:] I can reproduce the rewriting of [de] to [de_DE] if I start Kleopatra with LANGUAGE=de_DE on Linux.

  • en_US not matching with en_GB is probably not a bug

Correct. If you want some settings to be used for all country dialects of a language then don't add a country code to the locale specifier, i.e. use [en] instead of [en_US].

  • But de_DE not matching with de might still be a bug?

I don't think that's how gettext works. If you ask for German (de) then why should German from Germany (de_DE) be used? The fallback only works in the other direction, i.e. if the locale is de_DE then de is used in case there's no de_DE.

[added:] I noticed that I get the "de_DE" hint if I start Kleopatra with LANGUAGE=de on Linux (without configured language in Kleopatra). But with configured language "German (de)" in Kleopatra (and without setting the LANGUAGE variable) I don't get the "de_DE" hint. That's odd.

[added:] On Linux the "de" hint isn't used if I set the configured language "German (de)" in Kleopatra. But it is used if I force the language with LANGUAGE=de. WUT? This could be an order problem. Maybe kleopatrarc is read before the configured language is set.

• ikloecker added a project: gpd5x.
• ikloecker moved this task from Backlog to WIP on the gpd5x board.

I confirmed that we have a "race" between reading the config file and setting the configured language. When I "update" the locale of the shared config object before reading the values for the CSR creation dialog then the "de" hint and also the "de_DE" hint are used if the configured language in Kleopatra is "German (de)". This "race" doesn't seem to exist for VSD 3.4 (or on Windows).

I can also confirm the problem that "de_DE" hint is not used if the configured language is in Kleopatra is "German (de)" and if I use the same code as on Windows. The problem here is that we set the locale of the config object to "de" (i.e. the configured language) which lacks a country code. On Linux we use the locale name which is always language ID + country code.

With regard to the custom configuration files you should always specify a language-less fallback value for the custom values, e.g.

CN_hint[de_DE][$i]='Vorname Nachname' eingeben.
CN_hint[en_US][$i]=Enter 'Firstname Lastname'.
CN_hint[$i]=Enter 'Firstname Lastname'.

or, because in this example the "en_US" value is superfluous, simply

CN_hint[de_DE][$i]='Vorname Nachname' eingeben.
CN_hint[$i]=Enter 'Firstname Lastname'.

For Gpg4win 5 I've added a patch (upstreamed as https://invent.kde.org/frameworks/kconfig/-/merge_requests/484) which fixes the problem that config values with language specifier [de_DE] were not read if the configured language in Kleopatra is "German (de)".

@ebo Shall this patch be backported for VSD 3.4? (I think it's safe to backport it.)

• ikloecker mentioned this in Unknown Object (Maniphest Task).Oct 12 2026, 9:53 AM

Backported for VSD 3.4

• ikloecker changed the task status from Open to Testing.Oct 12 2026, 11:34 AM

The issue that needed to be fixed in kconfig has been fixed.

To make the en_GB case work with the custom configuration see comment T8478#224321 (and/or use country-less locale specifiers)

• ikloecker mentioned this in Unknown Object (Maniphest Task).Oct 19 2026, 9:32 AM
timegrid changed the task status from Testing to Open.EditedFri, Nov 13, 12:15 PM

On gpg4win-5.2.0-beta882 (gpg-2.5.24, gpgol-2.7.4) @ win11 there still seems to be an issue with the fallback (no language) setting, when the Kleopatra language is set to default. All other cases are fine now.

kleoptrarc
[CertificateCreationWizard]
CN_hint[de_DE][$i]=CN_hint de_DE
CN_hint[en_US][$i]=CN_hint en_US
CN_hint[$i]=CN_hint fallback
EMAIL_hint[de][$i]=EMAIL_hint de
EMAIL_hint[en][$i]=EMAIL_hint en
Windows Display LanguageKleopatra LanguageCN_hintEMAIL_hint
English (United States)Defaultfallback (expected: en_US)en
American English (en_US)en_USen
British English (en_GB)fallbacken
Deutsch (de)de_DEde
Deutsch (Deutschland)Defaultfallback (expected: de_DE)de
American English (en_US)en_USen
British English (en_GB)fallbacken
Deutsch (de)de_DEde
English (UK)Defaultfallbacken
American English (en_US)en_USen
British English (en_GB)fallbacken
Deutsch (de)de_DEde

Note: The position of CN_hint[$i] does not matter, both configurations will have the same effect:

CN_hint[en_US][$i]=CN_hint en_US
CN_hint[$i]=CN_hint fallback
CN_hint[$i]=CN_hint fallback
CN_hint[en_US][$i]=CN_hint en_US

The problem is that QLocale::uiLanguages() returns "de-Latn-DE", "de-DE", "de-Latn", "de", "en-Latn-US", "en-US", "en-Latn", "en" as list of UI languages. kconfig uses the first one, i.e. "de-Latn-DE" (but with '-' replaced with '_'). Obviously, "de_Latn_DE" != "de_DE".

And indeed, if I add

CN_hint[de_Latn_DE][$i]=CN_hint de_Latn_DE

then I get the hint "CN_hint de_Latn_DE".

I suggest that you forget about language codes with country codes and always use only [de], [en], etc. For German the alphabet specifier "Latn" is superfluous but for many other languages it's not. Hence, I don't want to remove it to make config values with [de_DE] work. And it's out of the question to make kconfig even more complex to support all kinds of variants of the language specifiers or multiple locales (like the whole list returned by QLocale::uiLanguages()).

timegrid changed the task status from Open to Testing.Wed, Nov 18, 10:42 AM

I suggest that you forget about language codes with country codes and always use only [de], [en]

Allright, that's fine for me.

timegrid edited projects, added gpd5x (gpd-5.2); removed gpd5x.