Bug 1228104

Summary: Separate language from locale during the installation
Product: [openSUSE] openSUSE Tumbleweed Reporter: Martin Gustafsson <martin.n.gustafsson>
Component: InstallationAssignee: E-mail List <yast2-maintainers>
Status: RESOLVED UPSTREAM QA Contact: Jiri Srain <jsrain>
Severity: Enhancement    
Priority: P5 - None CC: lubos.kocman, mrmazda
Version: Slowroll   
Target Milestone: ---   
Hardware: All   
OS: openSUSE Tumbleweed   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Martin Gustafsson 2024-07-18 10:42:20 UTC
User-Agent:       Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Build Identifier: 

When installing openSUSE one can specify language, keyboard and time zone, but not locale. The locale seems to be dependent of the language (which is not the case in reality). This is a problem for all of us who prefer to use English as language but want 24h clock, iso8601-dates, week starts on Monday, papersize A4 etc..
So I have to choose from having good locales but the computer talking to me in bad (in my case) Swedish or English but with bad locales. 
The first time I installed openSUSE I selected English as language, but got bad locales. When trying to switch locales in KDE, everything went bad and I could not use the keyboard anymore. So I reinstalled.
The second attempt I made, I used Swedish as language to get the good locales and then I switched language in KDE to get the computer talking to me in English. However all folders in the desktop were already created with Swedish names, so I had to rename them and update the links in KDE with the English name. Also, KDE set LC_TIME=en_SE.UTF-8, which is not available on the system
The locale en_DK is almost what I want. The problem with en_DK is the dates are not iso8601 but old fashioned European style EU have agreed to move away from. What I would like to have is en_SE, but it is not available in openSUSE, so I created it myself.
I am not sure how to implement the mix of language and locales is an easy way. But I can compare the installation of Debian, where language, keyboard, locales, time zone were 4 independent separate parameters given during the installation. After these 4 were given, Debian generated the settings just as I wanted it perfectly. I don't see any en_SE so I don't know how it is done and maybe it is not needed if a custom locale is generated.

Reproducible: Always

Steps to Reproduce:
1.Install openSUSE with Enlish
2.Check calendar in KDE
3.
Actual Results:  
The calendar shows dates in another format than iso8601

Expected Results:  
Date as iso8601, 24h clock and all other units like we have them in my country

Asked me what language AND locales I want. Given me English as language but international units like en_SE does
Comment 1 Martin Gustafsson 2024-07-18 10:55:05 UTC
EDIT: I don't remember if I used yast of KDE to swicth language the first time when my keyboard stopped working. The second time I used the language settings in KDE which worked, but messed up my Desktoip shortcuts and set a locale which is not available.
Now I have this:
LANG=en_DK.UTF-8
LC_CTYPE="en_DK.UTF-8"
LC_NUMERIC=en_SE.UTF-8
LC_TIME=en_SE.UTF-8
LC_COLLATE="en_DK.UTF-8"
LC_MONETARY=en_SE.UTF-8
LC_MESSAGES="en_DK.UTF-8"
LC_PAPER="en_DK.UTF-8"
LC_NAME="en_DK.UTF-8"
LC_ADDRESS="en_DK.UTF-8"
LC_TELEPHONE="en_DK.UTF-8"
LC_MEASUREMENT="en_DK.UTF-8"
LC_IDENTIFICATION="en_DK.UTF-8"
LC_ALL=
To generate en_SE in openSUSE, I followed this:
https://www.linuxquestions.org/questions/linux-desktop-74/i-want-to-install-the-locale-en_se-on-opensuse-15-1-a-4175661655/
Comment 2 Stefan Hundhammer 2024-07-18 14:46:47 UTC
This is a well-known problem, but not one that YaST can fix.

We developers are all in the same boat: We need to use English to communicate with people all over the world, but that does not mean that we also want to endure those insane US date (Aug 7, 2027 - WTF?) or time (AM / PM - WTF?) formats (or, heaven forbid, those medieval units that only 3 countries on this planet are still using: USA, Myanmar, Liberia).

So sadly, we are left with setting up our locale environment with all those environment variables. I have:

% locale

LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC=en_US.utf8
LC_TIME=de_DE.utf8
LC_COLLATE=de_DE.utf8
LC_MONETARY=de_DE.utf8
LC_MESSAGES=en_US.utf8
LC_PAPER=de_DE.utf8
LC_NAME=de_DE.utf8
LC_ADDRESS=de_DE.utf8
LC_TELEPHONE=de_DE.utf8
LC_MEASUREMENT=de_DE.utf8
LC_IDENTIFICATION=de_DE.utf8
LC_ALL=

...which I all set in my shell startup files (~/.zshrc in my case).


That sucks, but there is no reasonable solution in sight.

Even worse, each and every desktop contributes by overriding some or all of it, and if you happen to click in the login manager, you may find yourself with a ~/.dmrc that overrides the override. Or with a ~/.pam_environment file that also kills your carefully hand-crafted defaults.

I wish I had better news for you, but this is a mess that will only become messier the more subsystems are involved. Since YaST can by definition only modify system defaults, even if we would start doing our own thing here, all the other subsystems would come after us and override whatever we do:

After reading and applying values from, say, /etc/sysconfig/locale, the login manager would throw its interpretation of what is probably good for you in the ring, then maybe ~/.pam_environment, then the plethora of files that the desktops and everybody else keep writing to ~/.config/whatever/wherever (and the order in which they are evaluated may vary from week to week). And that would be what you'd get whenever you start a program from your desktop's menus or from an icon on the desktop.

If you start a shell window, of course, that will use your values from ~/.bashrc (or ~/.profile or ~/.login; depending on whether or not it's a login shell) and override the overridden values once more.

As I wrote, it's a mess. YaST can't sort that out. Sorry.
Comment 3 Stefan Hundhammer 2024-07-18 14:51:07 UTC
I know it's highly unsatisfactory, but this needs fixing somewhere higher up in the food chain (X Desktop Group as an organization above the desktops?).
Comment 4 Stefan Hundhammer 2024-07-18 15:01:12 UTC
Also please consider the various applets of your desktop that override things like the keyboard layout. I lost count how many times I screamed at my screen because one of them believed it knew better than what I explicitly selected, and of course it always takes time to find where and how to restore the value that I really want.
Comment 5 Martin Gustafsson 2024-07-18 15:39:02 UTC
Thanks for your reply.
The possibility to chose a non-US variant of English (en_DK, en_CAN, en_SE + maybe some more) in case English is selected would satisfiy a vast majority on non-US users I think. Or is it more difficult?
Comment 6 Felix Miata 2024-07-19 20:48:40 UTC
There /are/ US users besides me who want better too. iso8600 as default regardless of locale would be nothing but win for everyone. Every day has 24 discrete hours of 60 minutes of 60 seconds each. So worldwide should clocks. Inches and feet had their uses, but the economy has been global for well over a century. Every measurement should default to simple-to-understand metric and decimal points. Make it so those who wish to be different have to do the extra work, rather than those who appreciate universally sensible standards.