4

I am on a multi user Debian Stretch system which has en_US.UTF-8 as default locale, but I want de_DE.UTF-8 for my user. I was able to set it for terminals, by adding export LANG=de_DE.UTF-8 to ~/.bashrc.

The problem is that my X environment (with XFCE as window manager and lightdm as login manager) still uses the default locale, which isn't a surprise as .bashrc is just for bash. So I tried setting the variable in various other files:

~/.xinitrc

This file doesn't seem to get executed at all.

~/.config/xfce4/xinitrc

Setting the variable here didn't work either (no observed change in behaviour). Also, if I switch the window manager, I need to set it for the new one again, which isn't very appealing.

~/.xsession

Setting the variable here presumably works, but I would also need to start the window manager here, so I'm hoping to find a better place.

~/.pam_environment

Seems to be ignored on Debian

~/.xsessionrc

Setting environment variables here actually seems to work, but it looks like LANG is set to en_US.UTF-8 later in the startup process.

~/.i18n

Setting a language here doesn't seem to work.

It seems like all these aren't the right place to set the LANG variable. Where should I set it, to get the desired result?

  • ~/.pam_environment is read by default on Debian. Did you write LANG=de_DE.UTF-8 or export LANG=de_DE.UTF-8? export is wrong there, this isn't a shell script, just a list of VARIABLE=value lines. – Gilles Feb 6 '16 at 21:41
  • I wrote LANG=de_DE.UTF-8. I also tried TEST=something to be sure that LANG isn't overwritten somewhere else. However, I TEST wasn't set on either physical or X terminals. – Kritzefitz Feb 7 '16 at 16:36
0

I had the same problem that the language is not correctly set by lightdm (see this bug). Adding the LANG exports to both .bashrc and .xsessionrc did the trick for me. I export to LANG, LANGUAGE and LC_ALL to be sure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.