After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 603853 - /etc/gdm/Xsession breaks LANGUAGE
/etc/gdm/Xsession breaks LANGUAGE
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
2.29.x
Other Linux
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2009-12-05 17:02 UTC by David Planella
Modified: 2010-08-12 14:00 UTC
See Also:
GNOME target: ---
GNOME version: 2.29/2.30


Attachments
remove $GDM_LANG (2.38 KB, patch)
2010-03-04 11:12 UTC, Martin Pitt
none Details | Review
Do not overwrite $LANGUAGE and other locale variables (1.67 KB, patch)
2010-03-04 11:58 UTC, Martin Pitt
accepted-commit_now Details | Review

Description David Planella 2009-12-05 17:02:46 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
Comment 1 Martin Pitt 2010-02-25 13:13:06 UTC
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.
Comment 2 Takao Fujiwara 2010-03-03 13:13:18 UTC
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 ?
Comment 3 Martin Pitt 2010-03-04 11:12:54 UTC
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.
Comment 4 Martin Pitt 2010-03-04 11:58:05 UTC
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!
Comment 5 William Jon McCann 2010-06-19 13:54:05 UTC
Ray, what do you think?
Comment 6 Martin Pitt 2010-08-06 10:31:58 UTC
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 7 Ray Strode [halfline] 2010-08-12 13:42:57 UTC
Comment on attachment 155220 [details] [review]
Do not overwrite $LANGUAGE and other locale variables

totally okay to prod.
Comment 8 Ray Strode [halfline] 2010-08-12 13:43:52 UTC
(patch makes a lot of sense, it's just left over cruft)