Problem with locale settings and i3

Hi everyone,

after I used manjaro for years (with xfce) and than for lack of a private laptop / computer went to using only windows (at work) for a long time, I’m back to manjaro, this time trying out i3.

I currently have a problem with i3 which I think is coming from my locale settings.

So when I try to run i3status from console it gives me:

Could not set locale. Please make sure all your LC_* / LANG settings are correct.

Now I’m a bit confused because I have both a /etc/locale.conf file and a /etc/default/locale file and was used to having only one of those but I might be halucinating as my linux experience is quite a few years old. Anyway, if I run locale I get the following:

Could not set locale. Please make sure all your LC_* / LANG settings are correct.
LANG=DE
LC_CTYPE=de_DE.UTF-8
LC_NUMERIC=de_DE.UTF-8
LC_TIME=de_DE.UTF-8
LC_COLLATE="de"
LC_MONETARY=de_DE.UTF-8
LC_MESSAGES=de_DE.UTF-8
LC_PAPER=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=

So there are two things looking strange to me without deeper knowledge, one is that it is bothered by LC_ALL being empty, which to my knowledge should usually not be set unless within specific contexts and the other is that LANGUAGE isn’t appearing although I set it (in both /etc/locale.conf and in /etc/default/locale).
LC_ALL is not set in the locale.conf and to my knowledge can’t be set there.

Many programs are crashing with similar errors. When I do “export LC_ALL=de_DE.UTF-8” subsequent commands work fine but it is far from ideal having to export that variable each time anew and of course I could put that export command somwhere in the startup sequence but that isn’t how it’s meant to be (to my knowledge). Content of my locale.conf:

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

I have managed that configuration manually in the past but looking at it through the manjaro-settings-manager doesn’t reveal anything strange, everything seems configured correctly in there everything is set to german. I have 3 languages installed (manually generated by editing the locale.gen and running locale-gen), de_DE en_US und es_PE all with UTF-8

I’ve already done a search in the forums and while I have found similar problems with similar error messages, none of the solutions worked or was applicable.

Should be:

Set it in /etc/locale.conf, run sudo locale-gen, then reboot for it to take effect.

It should either be missing or blank.

If you looked at what is set in locale.conf, there LANG=de_DE.UTF-8 is set.

I have no idea why it appears different when I run locale.

I have run sudo locale-gen and rebooted lots of times since the last time i modified those files…

edit: Also: I have no idea where LC_COLLATE=“de” comes from.

So LC_LANG and LC_COLLATE get values from “somewhere else”, while LANGUAGE isn’t set at all (dunno if it is even that necessary but…). But where that “somewhere else” is. It does not seem to be anywhere in /etc/ as a search for the string LC_COLLATE comes up basically empty.

1 Like

Unfortunately that all doesn’t help me.

I have checked my locale.conf, I have checked the locale.gen I have rebuild my locals using locale-gen. all needed locales (well only de_DE.UTF-8) that I mentioned in the locale.conf are there and where the LC_COLLATE and LANG come from when running locale, I have no ■■■■■■■ clue.

locale -a gives me:

C
C.utf8
POSIX
de_DE.utf8
en_US.utf8
es_PE.utf8

localectl gives me:

System Locale: LANG=de_DE.UTF-8
    VC Keymap: de
   X11 Layout: de
  X11 Variant: neo

I’ll try setting LC_COLLATE in the locale.conf

OK, setting LC_COLLATE=de_DE.UTF-8 seems to have done the trick. I still have no idea why it appeared as LC_COLLATE=“de” and where that came from as I did never set it.

anybody any idea? I’d like to know what was going on…

The only place one use that kind of shorthand, is for setting console keyboard using vconsole.conf

Configuring locales should always follow the scheme found in /etc/locale.gen

Having an entry like you describe - the most proable cause is a manual edit - or a manually crafted script.

A valid locale.conf is like this example - using english as language with danish locale standards - LC_ALL should always be empty but you can have a LANGUAGE as described in the wiki

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

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.