Bug 198260

Summary: LANGUAGE environment variable empty
Product: i18n Reporter: Franz <calcifer>
Component: generalAssignee: Lukáš Tinkl <lukas>
Status: CONFIRMED ---    
Severity: wishlist CC: caslav.ilic, kde, ville.skytta
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

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 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

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):
There somebody notes that this (was) set during the KApplication constructor in
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.