Where is the LANGUAGE environment variable set?

In what configuration file is the LANGUAGE environment variable set? (Or how can I change it by other means?)

Background: I was playing around with language settings in kubuntu and installed Russian by accident. Now it won't totally go away. Yes, english shows up in the GUI, but it's Russian on the command line. As best I can figure, it's due to the LANGUAGE environment variable. See the third line:

leon@leon-Desktop:~$ locale
LANG=en_US.UTF-8
LANGUAGE=en:ru:en
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=

Everything is set correctly except for LANGUAGE. I've gone through a number of instructions for how to configure the locale/language, but nothing seems to change LANGUAGE (although they have changed other environmental variables, like LANG). So, I'm not interested in an overview of how to change the locale. I need to specifically know how to change LANGUAGE (unless I'm totally misunderstanding the situation). For what it's worth, LANG is set in /etc/default/locale, but LANGUAGE is not set there. (I tried setting LANGUAGE there, and it gets overridden somehow.) If I manually set LANGUAGE to en, then that particular shell works fine, so I think that only LANGUAGE needs to be changed.


EDIT:

Just to make clear, setting LANGAUGE in /etc/default/locale does not help. Additionally, ~/.pam_environment does not exist.

See below. LANGUAGE is set to "en" in /etc/default/locale. I restarted the machine. I verified the contents of /etc/default/locale. However, apt-get still outputs in Russian because LANGUAGE was overwritten elsewhere (producing the above output from locale).

leon@leon-Desktop:~$ cat /etc/default/locale 
LANG="en_US.UTF-8"
LANGUAGE="en"
leon@leon-Desktop:~$ cat ~/.pam_environment
cat: /home/leon/.pam_environment: No such file or directory
leon@leon-Desktop:~$ sudo apt-get update
Игн http://mirror.anl.gov utopic InRelease

...

EDIT 2:

It looks like ~/.kde/env/setlocale.sh was the culperate. I guess I'll file a KDE bug report.

$ cat ~/.kde/env/setlocale.sh
export LANGUAGE=en:ru:en
export LANG=en_US.UTF-8
export LC_NUMERIC=en_US.UTF-8
export LC_TIME=en_US.UTF-8
export LC_MONETARY=en_US.UTF-8
export LC_PAPER=en_US.UTF-8
export LC_IDENTIFICATION=en_US.UTF-8
export LC_NAME=en_US.UTF-8
export LC_ADDRESS=en_US.UTF-8
export LC_TELEPHONE=en_US.UTF-8
export LC_MEASUREMENT=en_US.UTF-8

Solution 1:

Taken from help.ubuntu.com

The LANGUAGE priority list

The "LANGUAGE" environment variable, which is set by the GUIs more often than not on 
Ubuntu desktops, controls language for message and menu display for GNU compatible 
applications. For such applications it overrides whatever locale names are set in 
"LANG" and "LC_MESSAGES".

Unlike "LANG" and "LC_*", "LANGUAGE" should not be assigned a complete locale name 
including the encoding part (e.g. ".UTF-8"). Instead "LANGUAGE" should contain a 
colon separated priority list of language codes, for instance "es:de:en". A single 
language code is also correct.

As lame as a link answer is, this is probably what you want.

The post referenced in the link above explains that if you want to change the language that appears on the command-line then you need to set both LANG and LANGUAGE accordingly in either /etc/default/locale or ~/.pam_environment.

Since you've already tried setting LANGUAGE in /etc/default/locale, I'd try setting it in ~/.pam_environment since that's a user config file and its contents should overwrite anything set in the global environment.

EDIT:

I went ahead and tried duplicating the problem that you described by setting LANGUAGE in /etc/default/locale to "en:ru:en" logging out and then logging back in. It worked. Error messages were then displayed in Russian, at least for the root account (which was the account I was testing this on). Changing the value of LANGUAGE to "en" fixed it.

Solution 2:

It sounds like you have the LANGUAGE variable set to ru:en or something in /etc/default/locale, so try to change it there to just en.

The answer, which Alexej Magura wrote, also mentions ~/.pam_environment. Possibly, since you have Kubuntu, other files may be involved instead (or also).