Bug 198260 - LANGUAGE environment variable empty
Summary: LANGUAGE environment variable empty
Status: CONFIRMED
Alias: None
Product: i18n
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR wishlist with 40 votes (vote)
Target Milestone: ---
Assignee: Lukáš Tinkl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-29 10:29 UTC by Franz
Modified: 2010-02-22 22:49 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Franz 2009-06-29 10:29:13 UTC
Version:            (using KDE 4.2.4)
Compiler:          gcc 4.4 from arch linux
OS:                Linux
Installed from:    Compiled From Sources

running this in konsole:
[mike@localhost ~]$ printenv | grep LANGUAGE
LANGUAGE=

LANGUAGE variable is set to empty string, and this breaks one of programs i use. So i'd like to ask not to set LANGUAGE when its value is empty.
Comment 1 Brad Hards 2009-06-30 13:15:18 UTC
I'm not seeing this as a KDE issue. Its presumably part of the distro setup.
Comment 2 Johannes Dewender 2009-11-17 02:17:27 UTC
This is NOT a distro setup issue, because it is NOT set by any distro scripts.
I don't have any scripts setting LANGUAGE in /etc or ~/

Additionally. When I start any non-kde terminal (tested: urxvt, xterm) I DON'T have LANGUAGE set. I only get my LANG=de_DE.UTF-8

Okay, now to the point why this is rather a bug than a wish:
I have (in Konsole)
$ env | grep -i lang
LANG=de_DE.UTF-8
LANGUAGE=

But because LANGUAGE has higher precedence (and is empty) some locale-aware programs think I don't have a language set. In particular "ruby-locale" has this impression. I also want to note though, that other tools ignore the empty LANGUAGE.

My test-case are the above set LANG=de_DE.UTF-8 from me and LANGUAGE= from kdelibs and ruby-locale: http://rubyforge.org/projects/locale/
in Konsole:
$ irb
irb(main):001:0> require 'locale'
=> true
irb(main):002:0> Locale.current
=> []

in xterm:
$ irb
irb(main):001:0> require 'locale'
=> true
irb(main):002:0> Locale.current
=> [#<Locale::Tag::Posix: de_DE.UTF-8>]

Both logged in with the same user in fluxbox (only using KDE apps like Konsole) and both use bash.

Also note an older bugreport for Konsole (which is not responsible):
http://bugs.kde.org/show_bug.cgi?id=149300
There somebody notes that this (was) set during the KApplication constructor in
KCatalogPrivate::changeBindings()
But that was before KDE4.
I am using KDE 4.3.3 at the moment in Arch Linux.

Yes, ruby-locale can change the behavior, but there is also no reason for KDE to set an empty LANGUAGE. It would be fine if the language set in KDE would get used (I set german, english)
Comment 3 Chusslove Illich 2009-11-21 14:36:42 UTC
ruby-locale should change the behavior, because LANGUAGE is used by GNU
extensions in gettext(3), and has nothing to do with locales. The man page
states that LANGUAGE is used only if not empty, so this is part of specified
behavior of gettext(3). KDE sets LANGUAGE to empty only if it wasn't in the
environment at all, and otherwise preserves its value. So this cannot really
be called a bug.

On the other hand, I acknowledge that touching environment in this way is
not the cleanest thing to do on the outside, and internally it's even worse.
It is compromise to achieve the desired functionality (internal control of
gettext(3)) without extensive additional code needed for proper solution
(replacement of gettext(3)), or another simple but dirty solution which
would be less portable and worse for peformance.

So I'm confirming this as wishlist item.