Bug 445471 - Setting the region for formats doesn't respect /etc/locale.conf
Summary: Setting the region for formats doesn't respect /etc/locale.conf
Status: RESOLVED NOT A BUG
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_formats (show other bugs)
Version: 5.23.3
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-14 11:50 UTC by benttotheright
Modified: 2021-11-14 13:54 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description benttotheright 2021-11-14 11:50:57 UTC
SUMMARY

I want to have British English as my system language, whereas formats such as time, date, currency, etc. are displayed according to German (more specifically, de_DE) standards. I set my system language by editing /etc/locale.conf such that it includes LANG=en_GB.UTF-8. System Settings → Personalisation → Regional Settings → Language also displays British English as the only and default language.

When I go to KDE Plasma's system settings to adjust the region for my formats though, setting the region completely overrides that setting even though it should only influence formats. Restarting the system and checking my locale settings via the command locale proves this as well since it puts out 

LANG=de_DE.UTF-8
LC_CTYPE=de_DE.UTF-8
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_COLLATE=de_DE.UTF-8
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES=de_DE.UTF-8
LC_PAPER=de_DE.UTF-8
LC_NAME=de_DE.UTF-8
LC_ADDRESS=de_DE.UTF-8
LC_TELEPHONE=de_DE.UTF-8
LC_MEASUREMENT=de_DE.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=

even though LANG=en_GB.UTF-8 is still set in /etc/locale.conf. Expected behaviour would be that LANG=en_GB.UTF-8 doesn't become LANG=de_DE.UTF-8. Weirdly enough, the entire system does not turn German. Only parts of it become German even though the output of the command locale indicates otherwise. 

Manually setting all locale flags as de_DE.UTF-8 (besides the LANG flag) inside /etc/locale.conf and setting the formats to "No Change" delivers the desired result.

STEPS TO REPRODUCE
1. Set the system locale by adding LANG=en_GB.UTF-8 to /etc/locale.conf
2. Go to System Settings → Personalisation → Regional Settings → Formats and choose the region Deutschland - Deutsch (de_DE)
3. Watch parts of your system become German and the output of the command locale only show German locale settings.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma:  
(available in About System)
KDE Plasma Version: 5.23.3
KDE Frameworks Version: 5.88.0
Qt Version: 5.15.2
Comment 1 hanyoung 2021-11-14 12:02:39 UTC
Yeah, because Language with only one language setting sets LANG, but formats also sets LANG. Ideally, language should set LANGUAGE. This will be solved in Language & Formats merge. (Hopefully we can land the merge in 5.24) In the meantime, I won't try to fix the old KCM.
Comment 2 hanyoung 2021-11-14 13:54:06 UTC
(In reply to hanyoung from comment #1)
> Yeah, because Language with only one language setting sets LANG, but formats
> also sets LANG. Ideally, language should set LANGUAGE. This will be solved
> in Language & Formats merge. (Hopefully we can land the merge in 5.24) In
> the meantime, I won't try to fix the old KCM.

I didn't read carefully, actually this is the intended behavior. Because LANG does control LC_* if the specific LC_* doesn't set. If you want English as Language and German formats. You should set LANG as German and LANGUAGE as en. Or LANG to en, LC_* to de_DE