How to properly set a locale on endeavouros?

I didn’t know if most of C is US. I’d suspect too many people would not like that if it were true, but I don’t have a concrete answer. Maybe? Maybe not?

Wasn’t getting it to stay set at C but with LANG set at US what you wanted? Or have I completely been confused because it’s late? Then wouldn’t this be closest to that?

i thought C would be the default which would be english language for most programs (i meant the language, not the formats - formats are exactly what i was trying to get rid of)

and yes, that’s what i wanted and that’s what i meant in my previous post. so i said that C is likely pretty close to that.

1 Like

Ok. I think I understand. Thanks for clarifying.

I didn’t know if I want to suggest this since you’ve pretty much gotten it where you want.

If you set LANG to US in your conf but leave everything else at C does that make a mess of it all again?

my conf right now is

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

since apparently it doesn’t matter what i set and it’s just going to take one value.
if i changed LANG to en_US, everything would change to that, including the dates and formats.

also it’s almost 5 in the morning here and i’d kinda prefer sleeping for a while. i might take a look at it later but i’m not sure if i’ll get any better results.

thanks for the help! <3

1 Like

Some notes:

  • Did you look at the contents of file /etc/profile.d/locale.sh? You could add some log outputs (something like: echo "LANG = '$LANG'" >> /tmp/mylog) there (as the first and last command) to see if that is changing your desired settings.
  • Maybe i3 has some specific settings that affect the locale variables? I’m not using i3, but here we should have several i3 users that could chime in.
1 Like

Hello,
I have read through this thread and if I have understood it correctly this is what you want:

I have played around a bit with “localectl” and may have found a solution.
solution.
You just need to extend the command line accordingly with the “LC_*=C.UTF-8” values. It’s a bit of work but it will produce what you want I think.

sudo localectl set-locale LC_MESSAGES=C.UTF-8 LC_NUMERIC=C.UTF-8 LANG=en_US.UTF-8

Then show the “/etc/locale.conf”:

LANG=en_US.UTF-8
LC_NUMERIC=C.UTF-8
LC_MESSAGES=C.UTF-8

If you have extended the command line accordingly and run it with “localectl” you should get a

sudo locale-gen

After that it should survive a system reboot. :thinking:

1 Like

I thought of that this morning but hadn’t the time to get back here yet. Editing the shell script could definitely work, I saw multiple examples online.

I don’t use i3 either and really know nothing about it. I’d it like other to tiling setups where it uses a different WM or does it have it’s own?

Yes @HPF-84E I do believe that is what @elishka was hoping to achieve. My understanding (way too late in the day for my :brain: to work well) was that it was all or nothing. Albeit, it didn’t make sense because my own is a complete mess, but stays that way.

The other thing I haven’t quite figured out is why locale was giving different output than localectl for @elishka. I get same results when I do so.

I3 will probably not make its own settings.

I don’t think that LC_ALL=… is a good choice. It overwrites your previous input. It should only be run for a certain amount of time during a session. localectl refuses to run that too.

15:48:46^jag@jag-81vr:
~> sudo localectl set-locale LC_ALL=C.UTF-8 LANG=en_US.UTF-8
[sudo] Passwort für jag: 
Failed to issue method call: Locale assignment LC_ALL=C.UTF-8 not valid, refusing.
15:49:24^jag@jag-81vr:

Have a look at this thread. It explains it very well.
https://stackoverflow.com/questions/30479607/explain-the-effects-of-export-lang-lc-ctype-and-lc-all

/etc/profile.d/locale.sh only sources /etc/locale.conf (i have no other locale configs) and exports the variables. it also says that if LANG is unset then it’s plain C but my LANG is set so that’s unchanged.
i3 shouldn’t have its own locale settings, i don’t see anything like that in ~/.config/i3/config

localectl is aware of these changes and they’re correctly set in /etc/locale.conf but after a reboot locale shows it’s en_US again,

just like before, unsetting and sourcing the locales before a reboot works but it’s reverted afterwards.

i’ve read the thread but i still don’t see why LC_ALL=C.UTF-8 is bad if i want a non-regional locale.
i can read and write accents and foreign characters just fine.

If you haven’t read this, please do.

i don’t think any of those apply, sorry. i don’t have a desktop environment or a display manager that would change my locale (or at least i don’t think i do, i don’t see anything weird there) nor is this an unofficial locale.

You want to set everything to LANG=C. Is that correct? I tried it and it works. I have not changed the keyboard layout as I am from Germany.
The content of /etc/locale.conf is always reconfigured based on your entries. So it makes no sense to enter anything there.
Here is what I have done:
Check if available:

17:23:51^jag@jag-81vr:
~> localectl list-locales
C.UTF-8
de_DE.UTF-8
en_US.UTF-8
17:25:29^jag@jag-81vr:

Make setting:

sudo localectl set-locale LANG=C.UTF-8

After reboot:

17:25:29^jag@jag-81vr:
~> localectl
System Locale: LANG=C.UTF-8
    VC Keymap: de
   X11 Layout: de
    X11 Model: pc105
17:29:03^jag@jag-81vr:

Check:

17:23:44^jag@jag-81vr:
~> locale
LANG=C.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=

cat /etc/locale.conf
LANG=C.UTF-8

As I said, I only changed the locale for the language and not the keyboard layout.

1 Like

this is what i did in earlier posts and i think it’s the best available option for me so far

$ cat /etc/locale.conf
LANG=C.UTF-8
LC_ALL=C.UTF-8
$ localectl
System Locale: LANG=C.UTF-8
    VC Keymap: us
   X11 Layout: us

my keyboard is handled with fcitx5 so it doesn’t affect my writing.

I have already written that before.
LC_ALL is ignored after a reboot because no setting is possible by default.
The fallback is probably used? I have no idea!
The first entry is created automatically if you follow my instructions.

i don’t think i fully get what you mean by “the first entry is created automatically”
i achieved this by editing /etc/locale.conf last night when i was solving the issue here and i get the same output from locale as you do.

Good question!
Answer: SystemD
No idea what exactly is being written in the background. But since SystemD you have to use “localectl” no matter what you write manually in /etc/locale.conf.
rtfm

now i understand even less. doesn’t localectl just write those settings to locale.conf?
editing locale.conf worked if i set LANG=C.UTF-8.
if it’s yet another systemd fault then i’ll be mildly disappointed.

1 Like