Bug 373115

Summary: Incorrect locale values in ~/.config/plasma* and environment variables
Product: [Applications] systemsettings Reporter: Maximiliano Curia <maxy>
Component: kcm_formatsAssignee: Sebastian Kügler <sebas>
Status: RESOLVED UPSTREAM    
Severity: normal CC: fincer89, luigi.toscano
Priority: NOR    
Version First Reported In: 5.8.4   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
See Also: http://bugs.debian.org/845788
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Maximiliano Curia 2016-11-30 16:02:21 UTC
This is a forward of the bug reported in the Debian bug tracker:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=845788

Currently the values used to fill the combos in the formats kcm come from a:
 QLocale::matchingLocales(QLocale::AnyLanguage, QLocale::AnyScript, QLocale::AnyCountry);

Sadly this includes values that are not supported by the system locales libraries, as qt uses it's own locales database. Even more, this disregards the fact that most users have only a subset of the locales generated (see the output of locales -a to obtain a list of the currently available locales).

The Debian report has been reassigned to the qt maintainers, and it might be that the issue can be addressed on the qt side. As per suggestion of Kai Uwe Broulik via irc I'm forwarding the issue here to raise the issue awareness.

The original report from "Jeroen N. Witmond" reads:

I live in the Netherlands but I prefer to communicate with my computer systems in English.  I have answered the related questions 
during the installation of Stretch Alpha 8 accordingly.

Now a number of applications complain about the locale. An example is:
jeroen@zandbak:~$ man ssh-keygen
man: can't set the locale; make sure $LC_* and $LANG are correct

The $LC_* variables appear to not be set.

jeroen@zandbak:~$ echo $LANG
en_NL.UTF-8
jeroen@zandbak:~$ echo $LANGUAGE
en_US:en

Some digging showed that en_NL.UTF-8 is an incorrect value, and that it is 
set in files:
jeroen@zandbak:~/.config$ grep en_NL *
plasma-locale-settings.sh:export LANG=en_NL.UTF-8
plasma-localerc:LANG=en_NL.UTF-8

Questions:
1. Can I overwrite the values in these files manually, or do I need to use some dialog?
2. How to keep other users from stubling on this problem?

Regards, jeroen.


Happy hacking,
Comment 1 Sebastian Kügler 2017-06-12 09:22:54 UTC
Hi Maximiliano, Jeroen, thanks for the report!

Unfortunately, we can't fix this problem in Plasma, as it would mean we'd work around Qt's abstraction, defeating the whole point of the locale system abstraction. This is an upstream problem in Qt.

As to your question 1.: Yes, you can just change the values in the config file (they will only be overwritten if you use the locale systemsettings module, so don't, and you'll be a happy camper).