kcm_regionandlang: add locale C to mapping and always set LANG and LC_*
Add locale C to glibc mappings so that locale C is actually saved to config file
Also set LC_* whenever LANG is set, this ensures LC_* are always up-to-date. In previous logic, LC_* can become out of sync if user change LANG to something else than changed it back.
For example, the current LANG is en_US.UTF-8. So the defaultLangValue() is en_US.UTF-8, if the user changed the lang to en_GB.UTF-8 then changed it back. On the save, m_settings->lang() is equal to defaultLangValue() - en_US.UTF-8. Then the LC_* are not saved. And we ended up with config files like this
[Formats]
LC_ADDRESS=en_GB.UTF-8
LC_MEASUREMENT=en_GB.UTF-8
LC_MONETARY=en_GB.UTF-8
LC_NAME=en_GB.UTF-8
LC_NUMERIC=en_GB.UTF-8
LC_PAPER=en_GB.UTF-8
LC_TELEPHONE=en_GB.UTF-8
LC_TIME=en_GB.UTF-8
[Translations]
LANGUAGE=en_US
The solution is to yeet defaultLangValue(), and always set LC_* if LANG is changed.
Edited by Han Young