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

Assigned To
Authored By
timegrid
Mon, Oct 5, 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.Tue, Oct 6, 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).Mon, Oct 12, 9:53 AM

Backported for VSD 3.4

• ikloecker changed the task status from Open to Testing.Mon, Oct 12, 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).Mon, Oct 19, 9:32 AM