Re: [Bug 407300] Re: /etc/gdm/Xsession breaks LANGUAGE

2010-03-23 Thread Martin Pitt
Arne Goetje [2010-03-21  8:20 -]:
> I think this code and the fallback list should be placed into a separate 
> library, so that it can be used by gdm and ubiquity/debian-installer to 
> set the LANGUAGE variable correctly.

I don't think we'll have time to add this to gdm anytime soon, though.
We still have tons of other and more pressing bugs to fix in gdm in
particular, and the desktop in general.

> I can split out the code from language-selector and create a 
> command-line interface to query the mapping. If you guys agree with 
> that, can we get this done until beta2?

Is that file hard to parse? It might be easier and more efficient to
parse the file directly than to call an external program and parse
its output?

Martin
-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

-- 
/etc/gdm/Xsession breaks LANGUAGE
https://bugs.launchpad.net/bugs/407300
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


Re: [Bug 407300] Re: /etc/gdm/Xsession breaks LANGUAGE

2010-03-22 Thread David Planella
El Mo 22 de 03 de 2010 a les 07:52 +, en/na Martin Pitt va escriure:
> David Planella [2010-03-20 19:32 -]:
> > • GDM can only write LANG (and the LC_xx categories)
> 
> Indeed, gdm does not currently have a concept of a "language list",
> just a locale picker.
> 
> > • language-selector can write LANGUAGE
> 
> (but also LANG)

But it seems that it either doesn't do it or GDM overwrites it. Arne
explained me last week that there is a problem with GDM restoring
the .dmrc file from /var/cache/gdm/$USER/dmrc, which might be related.

> 
> > • That effectively means that the language one selects in GDM is
> useless, since LANGUAGE has precedence
> 
> It's only useless if you fine-tuned your $LANG/$LANGUAGE in the
> language-selector. It does work fine if you didn't (and most people
> won't, I figure).
> 

It's not just about fine tuning. Simply selecting a language in language
selector will lead you to this situation. I've tried this:

  * 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). 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)

> So, I agree it's confusing, but I don't see how to easily rectify it.
> The best that comes to my mind is to disable the locale picker for
> users which have a $LANGUAGE set?
> 

If that would also stop GDM from setting LANG, it might be an option.
I'm not sure if all cases can be covered, but I think an aim could be
that GDM and language-selector have got some minimal sane interaction at
least, since right now they work totally independently of each other.

Arne, you proposed something else already, but I cannot assess how much
work it is involved or whether this is doable/worth doing until beta2.

If not, do you think there is anything else we could do to make GDM play
a bit nicer with language-selector?

-- 
/etc/gdm/Xsession breaks LANGUAGE
https://bugs.launchpad.net/bugs/407300
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Re: [Bug 407300] Re: /etc/gdm/Xsession breaks LANGUAGE

2010-03-22 Thread Martin Pitt
David Planella [2010-03-20 19:32 -]:
> • GDM can only write LANG (and the LC_xx categories)

Indeed, gdm does not currently have a concept of a "language list",
just a locale picker.

> • language-selector can write LANGUAGE

(but also LANG)

> • That effectively means that the language one selects in GDM is
useless, since LANGUAGE has precedence

It's only useless if you fine-tuned your $LANG/$LANGUAGE in the
language-selector. It does work fine if you didn't (and most people
won't, I figure).

So, I agree it's confusing, but I don't see how to easily rectify it.
The best that comes to my mind is to disable the locale picker for
users which have a $LANGUAGE set?

Martin
-- 
Martin Pitt| http://www.piware.de
Ubuntu Developer (www.ubuntu.com)  | Debian Developer  (www.debian.org)

-- 
/etc/gdm/Xsession breaks LANGUAGE
https://bugs.launchpad.net/bugs/407300
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Re: [Bug 407300] Re: /etc/gdm/Xsession breaks LANGUAGE

2010-03-21 Thread Arne Goetje
David Planella wrote:
> While the patch fixes the issue where Xsession was writing a LANGUAGE
> variable with incorrect syntax, now we've got a situation where:
> 
> • GDM can only write LANG (and the LC_xx categories)
> • language-selector can write LANGUAGE
> • That effectively means that the language one selects in GDM is useless, 
> since LANGUAGE has precedence
> • In some applications LANG (or LC_xxx) is used, though.
> 
> As a test, in my Catalan session I logged out, chose German as the
> language in GDM, logged back in and noticed:
> 
> • Most applications are in Catalan
> • The calendar is half Catalan, half German
  -> bug in the calendar code
> •  Firefox is in German
  -> bug in firefox


> $ locale
> LANG=de_DE.utf8
> language=ca...@valencia:ca_ES:ca:en_GB:en
> LC_CTYPE="de_DE.utf8"
> LC_NUMERIC="de_DE.utf8"
> LC_TIME="de_DE.utf8"
> LC_COLLATE="de_DE.utf8"
> LC_MONETARY="de_DE.utf8"
> LC_MESSAGES="de_DE.utf8"
> LC_PAPER="de_DE.utf8"
> LC_NAME="de_DE.utf8"
> LC_ADDRESS="de_DE.utf8"
> LC_TELEPHONE="de_DE.utf8"
> LC_MEASUREMENT="de_DE.utf8"
> LC_IDENTIFICATION="de_DE.utf8"
> LC_ALL=
> 
> This can be potentially very confusing to users switching locales.

I agree. Language-selector has code to generate the LANGUAGE variable 
out of any given LANG locale code. It uses the file 
/usr/share/language-selector/data/languagelist to find fallbacks for 
LANGUAGE and if the specific locale is not mentioned there, just strips 
the encoding and country code from the LANG value.

I think this code and the fallback list should be placed into a separate 
library, so that it can be used by gdm and ubiquity/debian-installer to 
set the LANGUAGE variable correctly.

I can split out the code from language-selector and create a 
command-line interface to query the mapping. If you guys agree with 
that, can we get this done until beta2?

-- 
/etc/gdm/Xsession breaks LANGUAGE
https://bugs.launchpad.net/bugs/407300
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs