How to properly set a locale on endeavouros?

no, i want LANG (and possibly LC_MESSAGES) to be en_US.UTF-8 and all others should be C.UTF-8

$ cat /etc/locale.conf
LANG=en_US.UTF-8
LC_CTYPE=C.UTF-8
LC_NUMERIC=C.UTF-8
LC_TIME=C.UTF-8
LC_COLLATE=C.UTF-8
LC_MONETARY=C.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_PAPER=C.UTF-8
LC_NAME=C.UTF-8
LC_ADDRESS=C.UTF-8
LC_TELEPHONE=C.UTF-8
LC_MEASUREMENT=C.UTF-8
LC_IDENTIFICATION=C.UTF-8
$ cat /etc/locale.gen
en_US.UTF-8 UTF-8
$ cat /etc/default/locale
LANG=en_US.UTF-8
LC_ADDRESS=C.UTF-8
LC_IDENTIFICATION=C.UTF-8
LC_MEASUREMENT=C.UTF-8
LC_MONETARY=C.UTF-8
LC_NAME=C.UTF-8
LC_NUMERIC=C.UTF-8
LC_PAPER=C.UTF-8
LC_TELEPHONE=C.UTF-8
LC_TIME=C.UTF-8

it shouldn’t only work with LC_ALL, output of date changed when i modified LC_TIME in current shell

$ date
Mon Mar 18 03:40:33 AM CET 2024
$ LC_TIME=C.UTF-8 date
Mon Mar 18 03:40:35 CET 2024
1 Like

Good to know. I’d read that elsewhere (i.e., not the Arch page).

Thank you, again. Those all look correct.

The locale.conf file should really only reflect the ones that you have changed. Technically, if that is blank, it should default to C.UTF-8. Whether it does or not, seems to be in question. Based on what you responded previously, it had not done so.

So, if you run sudo locale-gen and reboot, it doesn’t stay set? If you try again, do NOT run ```source /etc/profile.d/locale.sh````.

This is part of what is perplexing me at the mo’. When I run it on my system, it displays all of the settings I changed, as I changed them. Then the ones that were set at install time are listed in inverted commas. But yours only shows what was set at install?

when i sudo locale-gen with my current locale.conf and reboot without sourcing the locale.sh file nothing seems to happen, localectl reports the same as before and so does locale and the formats are still american.

yes, it seems so:

$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Indeed it does.

Hmmm, something else I just read said that whatever you set for locale at install is what it defaults to instead of C. And using C will just default back to what you had set.

I know it’s inconvenient, but you could set them each to whatever specific locale you want it to be (you don’t need to share what it is to maintain anonymity) and may need to do so to get it correct.

Edit: So in your case, it would default back to US.

it’s not about anonymity, there’s just no regional locale i want. i specifically want C because it does not follow any country’s customs.
…so now i need to reinstall the entire system to be able to set it that way?

1 Like

That’s what I am not completely certain about. As far as I know, you cannot install without selecting a language/locale. Thus, it will default to whatever you set.

For example, you could set it to cs_CZ.UTF-8 at install and then everything would default to that.

Edit:
I’ve never heard of a way of installing any Linux distro without selecting a locale, thus getting you where you don’t want to be.

Edit 2: Unfortunately, or not, I don’t actually think locale is causing any problems. It’s because you set it at US at install, that’s what C is defaulting to at this time.

that doesn’t seem to be correct. i can set C.UTF-8 manually:

$ export LC_ALL=C.UTF-8
$ locale
LANG=en_US.UTF-8
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=C.UTF-8

however, even after wiping my entire locale.conf and only letting

LANG=en_US.UTF-8
LC_ALL=C.UTF-8

be there and after rebooting my locale command gives the exact same output, with en_US everywhere.

1 Like

I think because the C defaults back.

What if you changed it to en_GB.UTF-8 and executing locale-gen and rebooting? Does that still leave everything at US or is it now changed?

i don’t think C is defaulting to anything else than C, that’s the entire point of the C locale. i can export it manually just fine and it behaves like the locale should. it just doesn’t work in locale.conf for whatever reason (or i think something might be rewriting it afterwards?)
i’m 99% sure you can have linux without a regional locale, i always set my language to be en_US without it affecting other parts of the system. i just messed up the installation this time.

that changed all the variables to the new locale and the system now uses that locale’s language.

That shouldn’t be happening as far as I know.

I had not thought so, but am happy to be wrong.

Aside from the locale.conf file not sticking with C. What in your system is not changing correctly to what you would like?

Okay, that at least shows it’s working correctly, even if it’s not what you want.

And if you set everything to C (similar to the change with GB) it doesn’t stay?

Okay, it’s late for me and I have to work soon and should sleep. I’ll try to make more sense of this when I’m at work in a few hours. Or at least as soon as I have time…

it’s hard picking a locale, especially for dates. non-english languages will print dates in their own language, americans have the am/pm system, british have something going on too. when i started using linux i used to use australian english for a locale because overall it was the least weird one.

1 Like

it stays that way and i guess i’ll have to stick to that for now (it’s not a bad choice i guess, most of C is the same as en_US anyway, right?)

1 Like

Yes, you’re totally right. I couldn’t agree more. Which is partly why I’ve not shown you what my conf file looks like. :laughing::scream::laughing:

I currently live in one country and have a couple things set because of that. I grew up in a different country and have a few things set because of that. Lastly, I have a few odd preferences and have other locale settings for that.

So I completely understand.

1 Like