r/archlinux 7d ago

$LANG not being set SUPPORT | SOLVED

echo $LANG results in an empty string despite following the wiki:

$ cat /etc/locale.conf
LANG=en_US.UTF-8

$ locale-gen              # run from previous boot

Default shell: zsh, nothing appears to override them:

$ sudo grep -ir 'LANG=' /etc
/etc/profile.d/locale.sh:LANG=${LANG:-C.UTF-8}
/etc/locale.conf:LANG=en_US.UTF-8

$ grep -ir 'LANG=' ~/.zshenv "$ZDOTDIR"   # no results

I suppose I can set it explicitly per $USER but it shouldn't be needed, right?

3 Upvotes

3

u/backsideup 7d ago

Which shells are you using for login and as an interactive shell?

0

u/immortal192 7d ago

Both are zsh.

2

u/backsideup 7d ago

If you log in via getty, is $LANG exported there? What if you log in as root?

6

u/immortal192 7d ago

Ahh I see the culprit--in my ~/.zshenv, I had set setopt no_global_rcs. So I guess explicitly setting it in user shell config is needed. Thanks.

0

u/immortal192 7d ago

User via getty, no, but yes for root. So something in user config is overriding it, hmm...