When running Lenny, I used to set locales for specific users running Xfce by copying /etc/xdg/xfce4/xinitrc to the users' home directory (under ~./config/xfce4) and then adding a simple export LANG=whatever to that file. That always worked AFAIR.
Unfortunately, so far I couldn't do the same in Squeeze, and for some reason that eludes me, it refuses to set the LANG variable.
By adding the following lines to ~./config/xfce4/xinitrc, I could verify that xinitrc is being executed, and that the variable is being set as it should.
echo $LANG > /tmp/xinitrc
However, something else must be overwriting it, because the whole environment is still in English, and the LANG variable shows en_US.UTF-8 after the Xfce session has been started.
I've also found some tips suggesting the use of the ~/.xsessionrc file for this purpose, which is seemingly "the Debian way" of doing it. So, if I create that file with the following contents, I can verify that is being called and that it's doing what it should (changing the variable), but after Xfce has started, everything is still in English and LANG remains set to en_US.UTF-8.
echo $LANG > /tmp/xsessionrc
I'm using gdm (the "classic" one, not gdm3) as my display manager, and if I change the language in gdm, the Xfce session uses the language chosen in gdm (which I suppose is the expected behavior).
So my questions are:
- What's overwriting the value that I'm setting for the LANG variable?
- How / where should I set it so that I can enforce a specific locale for Xfce and graphical applications?
It turns out that adding an export LC_ALL=es_ES.UTF-8 before the export LANG makes the variable value stick and Xfce starts in the chosen language. A couple of things:
- Why does this work on Lenny without needing to set LC_ALL, but doesn't work on Squeeze?
- I got the tip about setting LC_ALL from the LXDE documentation page that covers setting it up in Debian. However, the Debian documentation covering this doesn't seem to mention anything about LC_ALL needing to be set.
- My system (default) locale is en_US.UTF-8. I've generated es_ES.UTF-8 as an additional locale through dpkg-reconfigure locales.
- I need to set the alternative locale (es_ES.UTF-8) for specific accounts. The LC_ALL tip that I discovered before (see previous "UPDATE") works, but it has the side effect of translating console applications too (like apt), which is not what I want.