GNOME Bugzilla – Bug 603853
/etc/gdm/Xsession breaks LANGUAGE
Last modified: 2010-08-12 14:00:00 UTC
(Forwarded from the Ubuntu downstream bug at https://bugs.launchpad.net/ubuntu/+source/gdm/+bug/407300) /etc/gdm/Xsession contains: if [ -n "$LANGUAGE" ]; then if [ "$LANGUAGE" != "$LANG" ]; then LANGUAGE="$LANG" fi LANGUAGE is not only an extension of LC_MESSAGES (not LANG), it doesn’t even have the same syntax as LANG. My locale settings (whom /etc/gdm/Xsession breaks): LANG=fi_FI.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_NUMERIC=en_US.UTF-8 LANGUAGE=en_US:en I.e. “use fi for stuff like month names, paper size and units, but en for the UI strings and decimal numbers”. Notes: * From the bug's comments, it seems that this change was introduced as a result of the fix for https://bugzilla.gnome.org/show_bug.cgi?id=89970#c1, in this particular commit -> http://git.gnome.org/cgit/gdm/commit/?id=d6d92a4e00886ac5e6c5661bd9657068888e728a) * Some references on the LANGUAGE and LANG variables: ** http://www.linux.com/archive/feature/53781 ** http://www.openi18n.org/docs/html/LI18NUX-2000-amd4.htm
How about * if $GDM_LANG == $LANG, don't touch anything * if $GDM_LANG != $LANG, unset $LANGUAGE ? This should maintain the default case where you don't change your language in gdm, and if you do, it cleanly overwrites the system settings.
AFAIK, GDM_LANG is a deprecated valuable in the latest GDM HEAD. So probably does it make sense to just remove LC_ALL, LANGUAGE and LINGUAS lines in /etc/gdm/Xsession ?
Created attachment 155217 [details] [review] remove $GDM_LANG I grepped the code for $GDM_LANG, and except for a few obsolete translations in *.po files, the remaining places are: * said Xsession script: We do not have a facility to specify a list of languages in gdm, thus don't break $LANGUAGE if the user picks a locale. They have different syntax/meaning. LINGUAS is not a locale related environment variable at all. The only place where I've seen it is automake/autoconf scripts. * gdm-session-direct.c: Since $GDM_LANG was only used in Xsession.in, no need to export it any more.
Created attachment 155220 [details] [review] Do not overwrite $LANGUAGE and other locale variables Oops, thinko. We do need $GDM_LANG, because gdm_session_direct_set_environment_variable() runs before sourcing /etc/default/locale, /etc/profile, and friends. Thus we need to set it in the Xsession script indeed. Fixed patch attached. Sorry for the blunder!
Ray, what do you think?
Sorry to prod, but this quite clearly breaks the intended usage of $LANGUAGES. If you are unsure about whether or not to set LC_ALL etc., then we can keep those bits, and just drop the LANGUAGE="$LANG" for now?
Comment on attachment 155220 [details] [review] Do not overwrite $LANGUAGE and other locale variables totally okay to prod.
(patch makes a lot of sense, it's just left over cruft)
Thanks! Committed. http://git.gnome.org/browse/gdm/commit/?id=273bbb721d6da9beedf891864f9e0dc5d495deac