[Bug 553162] Re: Set $LANGUAGE if the user picks a different locale in gdm, so that language-selector and gdm stop disagreeing
Gunnar Hjalmarsson
553162 at bugs.launchpad.net
Thu Oct 7 23:34:04 BST 2010
Martin,
On 2010-10-07 11:11, Martin Pitt wrote:
> [gdm] just has a simple locale selector ... the main point is that
> you can start a desktop session in a different language.
That's crystal clear to me. And as long as language-selector didn't
distinguish between language and other locale aspects, the natural way
to serve that purpose was to let GDM set $LANG. There was no reason to
do it otherwise.
As from Lucid (revision 79 in language-selector, I think) language-
selector works differently, and currently it does not play well with
GDM. Making GDM and language-selector work well together in this
respect, i.e. preventing unexpected behavior and user confusion, is the
focus I have. Please note that I suggest changes to both language-
selector and GDM.
Keeping the limited purpose of GDM's locale selector in mind, i.e.
allowing users to start a session in a different language, I believe
that _now_ the best way to serve that purpose is to update $LANGUAGE and
set $LC_MESSAGES, while leaving $LANG to language-selector. In short:
Keep the purpose, change the method.
So, why do I persist, and claim that my method is better? As far as I
can tell, the patches I wrote make language-selector and GDM work
seamlessly together, without any cause left for users to get confused.
At the same time I can't see how going the other way, and just unset
$LANGUAGE, would be sufficient to prevent undesired user surprises.
In an attempt to make my point I added this code to Xsession:
if [ $( echo $GDM_LANG | sed 's/\..*//' ) != \
$( echo $LANGUAGE | sed 's/:.*//' ) ]; then
unset LANGUAGE
fi
Then I made sure that everything was set to Swedish to start with. Now,
please consider this scenario:
* I decide to switch the language (and nothing else) to en_US, and do so
from GDM.
* While now seeing English in menus and messages, I also see those
ambigous American date formats etc., which I don't want.
* Without actually understanding what happened, I go to Language Support
and open the tab for non-language locale settings. To my surprise, it
appears as if Swedish is still selected. Weird! Maybe a temporary
glitch...?
* I restart the computer. No change.
* This time, when in the Language Support tab for non-language locale
settings, I change (from Swedish) to something else, and then back to
Swedish. (I happen to know by now that that makes a difference, but does
the average user know? Probably not.)
* Restart.
* Now Swedish is the pre-selected _language_ in GDM. Seems like we are
back at square one. :(
This is certainly not what I want, and I'm sure that you do not want it
like that either.
So, what else can I say? Suppose most that can be said have been said by
now, so I simply beg you to reconsider and give my patches a chance. If
I'm proved wrong, by you or somebody else, I promise that I'll shut my
mouth. But only then. ;-)
--
Set $LANGUAGE if the user picks a different locale in gdm, so that language-selector and gdm stop disagreeing
https://bugs.launchpad.net/bugs/553162
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is a direct subscriber.
Status in Ubuntu Translations: Triaged
Status in “gdm” package in Ubuntu: In Progress
Status in “language-selector” package in Ubuntu: In Progress
Bug description:
Binary package hint: gdm
This is a follow-up to bug 407300, which has been fixed but a separate issue remains. I'm opening a separate task for language-selector, as it refers to the interaction between it and gdm.
The problem is basically that GDM seems to always override the LANG values set by language selector, and quite easily one can get to a situation where LANGUAGE and LANG differ and the desktop is a mixture of two languages.
Steps to reproduce (a):
* New install, choosing Catalan in the installer
* I log in without doing any changes to the language in GDM
* I start System > Administration > Language support
* I choose English there
* I log out
* I log back in without doing any changes in the GDM language chooser
* My session is half English and half Catalan due to LANGUAGE=en and LANG=ca_ES.utf8 (Firefox in Catalan, gnome-panel in English, gnome-menus in Catalan).
Steps to reproduce (b):
* Perform a full installation in English, as per http://testcases.qa.ubuntu.com/Install/NonEnglishLanguage#Installation%20Full%20Network%20Support
* Go to System > Administration > Language Support
* Install the Traditional Chinese language
* Bring Traditional Chinese to the top of the list to become the main desktop language
* Press the "Apply System-wide..." button
* Reboot
* When entering the session, you'll notice the desktop half translated in English, half in Chinese. The most noticeable parts shown in English are all the menus and Firefox. These applications seem to ignore the LANGUAGE variable
* Running 'locale' on the terminal shows that LANG=en_US.UTF-8 and LANGUAGE=zh_K:en_US:en
I understand that this might be a problem in each application, as they should give LANGUAGE preference. Rather than filing a bug in each app right now, would it not make more sense to ensure that at least the first locale in LANGUAGE, the one in LANG and LC_MESSAGES are the same? (assuming it is possible to do such a thing, of course).
Also see the related bug 552664
More information about the Ubuntu-sponsors
mailing list