You are not logged in.

#1 2021-05-14 16:28:44

desperado
Member
Registered: 2018-10-12
Posts: 59

[Solved] Locale variables cannot be changed the usual way

I wanted to change the locale variables to `en_US.UTF-8` (or something else), but can't seem to. I am using `zsh` + `startx`/`xinit`, if it helps.

Locales sure seem to be present.

> locale -a
C
POSIX
en_US.utf8

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

I can't seem to replace the "C"s with the conventional methods (/etc/profile, $HOME/.profile, /etc/locale.conf, $XDG_CONFIG_HOME/locale.conf).

Only `LC_ALL=$LANG` seems to do something.

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

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

> LC_ALL=$LANG
> 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=en_US.UTF-8

Found `~/.pam_environment`

LANGUAGE	DEFAULT=en_US:en
LANG	DEFAULT=en_US.UTF-8
LC_NUMERIC	DEFAULT=en_US.UTF-8
LC_TIME	DEFAULT=en_US.UTF-8
LC_MONETARY	DEFAULT=en_US.UTF-8
LC_PAPER	DEFAULT=en_US.UTF-8
LC_NAME	DEFAULT=en_US.UTF-8
LC_ADDRESS	DEFAULT=en_US.UTF-8
LC_TELEPHONE	DEFAULT=en_US.UTF-8
LC_MEASUREMENT	DEFAULT=en_US.UTF-8
LC_IDENTIFICATION	DEFAULT=en_US.UTF-8
PAPERSIZE	DEFAULT=letter

Removed it, no result.

I've even tried sourcing ` /etc/profile.d/locale.sh` after unsetting `LANG`. Even tried relogging in and restarting.


Can you help me out?

Last edited by desperado (2021-05-15 06:45:00)

Offline

#2 2021-05-14 17:10:28

ayekat
Member
Registered: 2011-01-17
Posts: 1,611

Re: [Solved] Locale variables cannot be changed the usual way

Have you consulted https://wiki.archlinux.org/title/Locale … the_locale?

--edit: Actually, sorry, I missed this part:

desperado wrote:

I can't seem to replace the "C"s with the conventional methods (/etc/profile, $HOME/.profile, /etc/locale.conf, $XDG_CONFIG_HOME/locale.conf).

What exactly did you write into the locale.conf files?

Last edited by ayekat (2021-05-14 17:11:57)


pkgshackscfgblag

Offline

#3 2021-05-14 17:33:22

desperado
Member
Registered: 2018-10-12
Posts: 59

Re: [Solved] Locale variables cannot be changed the usual way

ayekat wrote:

What exactly did you write into the locale.conf files?

> cat /etc/locale.conf
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

It was initially $XDG_CONFIG_HOME/locale.conf. I moved it for testing.

Last edited by desperado (2021-05-14 17:37:52)

Offline

#4 2021-05-14 18:26:36

seth
Member
Registered: 2012-09-03
Posts: 58,669

Re: [Solved] Locale variables cannot be changed the usual way

Contents of ~/.zprofile, ~/.zshrc and ~/.zshenv?

Offline

#5 2021-05-15 06:44:34

desperado
Member
Registered: 2018-10-12
Posts: 59

Re: [Solved] Locale variables cannot be changed the usual way

It's quite long to be any interesting, but I've found a line.

LC_ALL=C

I guess that was the problem. Found out from the wiki that you aren't supposed to set LC_ALL as a permanent variable (i.e. in a startup script).
Removed it and it's starting to work. Hope I haven't broken something else. Thanks.

Edit -
I asked the dotfiles author why it was put here.
Had something to do with this.
https://androidstudio.googleblog.com/20 … anary.html

Last edited by desperado (2021-05-15 14:16:53)

Offline

#6 2021-05-15 12:48:56

CarbonChauvinist
Member
Registered: 2012-06-16
Posts: 413
Website

Re: [Solved] Locale variables cannot be changed the usual way

desperado wrote:

I asked the dotfiles auther why it was put here...

So you were using someone else's dotfiles copied just willy-nilly as-is?


"the wind-blown way, wanna win? don't play"

Offline

#7 2021-05-15 13:01:51

seth
Member
Registered: 2012-09-03
Posts: 58,669

Re: [Solved] Locale variables cannot be changed the usual way

Welcome to almostarchlinux ;-)

Also

LC_ALL=C by default. To address issues with crashes and other problems stemming from different locales, we now set LC_ALL=C by default.

il_570xN.701495995_em32.jpg

Offline

#8 2021-05-15 13:23:04

desperado
Member
Registered: 2018-10-12
Posts: 59

Re: [Solved] Locale variables cannot be changed the usual way

CarbonChauvinist wrote:

So you were using someone else's dotfiles copied just willy-nilly as-is?

Yeah, big mistake.

Offline

Board footer

Powered by FluxBB