LC_MESSAGES not honored

Bug #190193 reported by Rolf Leggewie
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
belocs-locales-bin (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

I want to have a German environment, but English menus and error messages, etc. "LANG=de_DE.UTF-8 LC_ALL=de_DE.UTF-8 LC_MESSAGES=en_US.UTF-8" used to working just fine for that up until gutsy. All of the sudden, quite many menus and error messages are in German. Even the gdm login is already in German. I suppose this is a bug, but it might be that I have set something wrong or ubuntu policy changed in this aspect. In that case, please advise on how to do it correctly.

$ set|egrep '(LC_|LANG)'
GDM_LANG=de_DE.UTF-8
LANG=de_DE.UTF-8
LC_ALL=de_DE.UTF-8
LC_MESSAGES=en_US.UTF-8

$ LANG=de_DE.UTF-8 LC_ALL=de_DE.UTF-8 LC_MESSAGES=en_US.UTF-8 dpkg -i blahdeblah
dpkg: Angeforderte Operation benötigt Superuser-Rechte
$ LANG=de_DE.UTF-8 LC_ALL=de_DE.UTF-8 LC_MESSAGES=en_US.UTF-8 sudo dpkg -i blahdeblah
dpkg: Fehler beim Bearbeiten von blahdeblah (--install):
 Kann auf das Archiv nicht zugreifen: No such file or directory
Fehler traten auf beim Bearbeiten von:
 blahdeblah

From the way I understand LC_*, these messages should be in English, not German.

Revision history for this message
Rolf Leggewie (r0lf) wrote :

Just for the sake of being complete:

$ locale -a
C
de_DE.utf8
en_US.utf8
ja_JP.utf8
POSIX
$ LC_MESSAGES=en_US.utf8 sudo dpkg -i blahdeblah
dpkg: Fehler beim Bearbeiten von blahdeblah (--install):
 Kann auf das Archiv nicht zugreifen: No such file or directory
Fehler traten auf beim Bearbeiten von:
 blahdeblah

Revision history for this message
Ralf Doering (rdoering) wrote :

Desired behaviour, LC_ALL has precedence ove all other LC_* settings

Changed in belocs-locales-bin:
status: New → Invalid
Revision history for this message
Rolf Leggewie (r0lf) wrote :

The right thing to do it seems is to use "LANG=de_DE.utf8 LC_MESSAGES=en_US.utf8"

Revision history for this message
Rolf Leggewie (r0lf) wrote :

While this works reasonably well in Gnome, it does not on the VT where I get a German/English mix

$ set|egrep '(LC_|LANG)'
LANG=de_DE.utf8
LANGUAGE=de_DE:de:en_US:en
LC_MESSAGES=en_US.utf8

$ aptitude install asdlkjasdlfa
Paketlisten werden gelesen...
Abhängigkeitsbaum wird aufgebaut...
Reading state information...
Reading extended state information...
Initializing package states...
Building tag database...
E: Konnte Lockdatei /var/lib/dpkg/lock nicht öffnen - open (13 Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

Changed in belocs-locales-bin:
status: Invalid → New
Revision history for this message
Ralf Doering (rdoering) wrote :

(Assuming you have LC_*, LANG and LANGUAGE correctly exported)

Quoting locale(7):

       LC_MESSAGES
              changes the language messages are displayed in and how an affirmative or negative answer looks like. The GNU C-library contains the
              gettext(), ngettext(), and rpmatch() functions to ease the use of these information. The GNU gettext family of functions also obey
              the environment variable LANGUAGE.

Quoting gettext(3), which is referenced by locale(7):

       If the LANGUAGE environment variable is set to a nonempty value, and the locale is not the "C" locale, the value of LANGUAGE is assumed to
       contain a colon separated list of locale names. The functions will attempt to look up a translation of msgid in each of the locales in turn.
       This is a GNU extension.

Simply speaking, for GNU gettext LANGUAGE takes precedence over LC_MESSAGES. Your setup leads to first trying de_DE and de settings,
which generate valid german messages instead of your desired english messages.

I'm not seeing this as a bug with locales, so setting state of this bug to invalid again.

Changed in belocs-locales-bin:
status: New → Invalid
Revision history for this message
Rolf Leggewie (r0lf) wrote :
Revision history for this message
ΤΖΩΤΖΙΟΥ (tzotzioy) wrote :

My environment:

LANG=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LANGUAGE=en_US:en

LC_TIME=en_DK.UTF-8

LC_MONETARY=el_GR.UTF-8
LC_COLLATE=el_GR.UTF-8
LC_CTYPE=el_GR.UTF-8

and yet I still occasionally see installation related messages in Greek, so it's not LANGUAGE related. I assume that some packages check LC_CTYPE instead of LC_MESSAGES for translation purposes?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.