[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#632798: libc6: broken LANGUAGE design



Hi Jonathan,

On 2011-07-05 22:22:51 -0500, Jonathan Nieder wrote:
> 1. On my local machine, I could not reproduce the same effect.  That's
>    probably because no default locale is configured here.  After making
>    the default locale de_DE.UTF-8 using "dpkg-reconfigure -plow locales",
>    /etc/environment is empty and /etc/default/locale looks like this
> 
> 	#  File generated by update-locale
> 	LANG=de_DE.UTF-8
> 	#LANGUAGE=en_US
> 
>    and "ssh localhost locale" still shows "LANGUAGE=".  Any idea what's
>    different between your setup and mine?

My settings come from the installation. /etc/default/locale was:

#  File generated by update-locale
#LANG="en_US.UTF-8"
LANGUAGE="en_US:en"

(I only added a LC_TIME=en_DK since, hoping it would be taken into
account for the time displayed by gdm).

FYI, I installed the machine on 2010-01-04. I did:

$ wget http://cdimage.debian.org/cdimage/daily-builds/daily/arch-latest/amd64/jigdo-cd/debian-testing-amd64-netinst.jigdo
$ wget wget http://cdimage.debian.org/cdimage/daily-builds/daily/arch-latest/amd64/jigdo-cd/debian-testing-amd64-netinst.template
$ jigdo-lite debian-testing-amd64-netinst.jigdo

then

  growisofs -Z /dev/scd0=debian-testing-amd64-netinst.iso

to burn a DVD.

The installer asked me which language to use, and I chose English
(could be American English).

Note: I saw that on a machine reinstalled with Debian squeeze,
/etc/default/locale only sets LANG, but this may have been
manually set by the admin.

> 2. openssh-server has the following in its default sshd/config:
> 
> 	AcceptEnv LANG LC_*
> 
>    That is unfortunate.  Independently of everything else, this list
>    ought to be expanded to include LANGUAGE.

I agree. This would be a nice addition if /etc/default/locale does
not set LANGUAGE.

Now, if LANGUAGE is set in /etc/default/locale, this change may not
solve the problem due to:

  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=313317

However, even if this ssh bug is fixed, in case LANGUAGE is not
defined on the ssh client's side, the system must not set it by
default in the user's back. So, in short, LANGUAGE should not be
set in /etc/default/locale.

I agree concerning 3 and 4 (with corrected explanations).

> 5. As you mentioned, when LANGUAGE has an effect, it takes precedence
>    over LC_MESSAGES.  The principle of least surprise might indicate
>    that the locale in LC_MESSAGES should be used in preference to
>    LANGUAGE, but that would make it impossible to express something
>    like what is currently meant by
> 
> 	LANGUAGE=fr:de
> 	LC_MESSAGES=de
> 
>    on an installation where most programs are translated to German.
>    (It means: programs using catgets should use German, while programs
>    using gettext should prefer French if possible.  Intent: "I'd
>    prefer French, but barring that, please give me German instead of
>    English").

Hmm... OK, I thought that all programs were using gettext.

>    If one is willing to break with >10 years of gettext behavior, it
>    should be possible to change this without that downside by
>    prepending $LC_MESSAGES to LANGUAGE when and only when it is not
>    already an item in $LANGUAGE.
> 
>    A nice side-effect would be the ability to partially work around
>    (2), as you mentioned.
> 
> What do you think?  What pieces does the above description miss?

It would also be necessary that /etc/default/locale does not set
LANGUAGE (but perhaps this is already fixed for the new installers).
Said otherwise, as LANGUAGE is not standard (e.g. for portable Unix
scripts and other settings) and has the precedence, it should never
be set by the system, only by the user (who doesn't have necessarily
root access) if he wishes too.

And of course, the specification of LANGUAGE in the glibc manual
should be correct (bug 632795).

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)



Reply to: