Specific locale for each xorg-User

Imagine you have a multiuser system which has the locale ‘en_US.UTF-8’ per default. You are happy with it as you are nerd enough to deal with it. But your family and other users might want to use their browser, mailclient etc in another language.

Simply put a file called .xsessionrc into their homefolder which defines the locale they are about to use and chmod 600 the file.

This is a example setup on my machine. The default systems environment is set to english, but numbers, date and time is set to german.

/etc/environment:

LANG=en_US.utf8
LANGUAGE=
LC_CTYPE="en_US.utf8"
LC_NUMERIC="de_DE.utf8"
LC_TIME="de_DE.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="de_DE.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="de_DE.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="de_DE.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=

The user nerd has the same settings - nothing changed here. This user has an english speaking userinterface. Leave the file empty or simple drop it.

/home/nerd/.xsessionrc

# no contents here...

Alice just speaks german and does not understand anything at all of this linux stuff. Let her desktop be completely in german.

/home/alice/.xsessionrc

LANG="de_DE.UTF-8"
LC_ALL="de_DE.UTF-8"

Bob is a native frenchmen and wants his desktop to be in french completely:

/home/bob/.xsessionrc

LANG="fr_FR.UTF-8"
LC_ALL="fr_FR.UTF-8"

Addition: newer GNU/Linux usespace tools claim that ‘/etc/environment’ is deprecated. Well, then use ‘/etc/default/locale’ instead!