[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: KLocale weirdnes
From:       "Jacek Konieczny" <jajcus () zeus ! polsl ! gliwice ! pl>
Date:       1998-03-01 15:53:31
[Download RAW message or body]

> Jacek Konieczny wrote:
> > 
> > Hi!
> > 
> > I just wanted to fix kpanel to display time using locale. But it didn't worked.
> > So, I looked into klocale.cpp and I found out, that locale is always set to
> > "C", and LANG variable is only used for message translations.
> > 
> > Why it is done this way. If there is no one who may give a reason with sense,
> > I will fix it to set locale using 'setlocale(LC_ALL,"")'.
> > 
> > Not only messages are controled by locale, so it should be used.
> > Also there should be possibility to set messages using LC_MESSAGES, and having
> > other variables set to "C",
> > 
> > This way it is done now KDE is not consistent with other locale-using
> > applications.
> > 
> I have no idea, how the "C" can came in. But I think, a better way than
> "" would
> be to use the lang variable, that klocale finds out, since libc has no
> idea about
> ~/.kderc ;)

You are right, but locale is not only message translations. I may want to have 
messages in English and everything else as it is used in Poland.
Thats why there are several locale categories like LC_MESSAGE, LC_CTYPE, 
LC_TIME...
I have just changed klocale to uses standard locale handling, when no KDE 
language is set. Then LC_MESSAGES setting is read and used instead of LANG 
variable.
This way I can have Polish messages using diffrent settings for example:
LANG=pl
LANG=polish
LC_MESSAGES=pl_PL
... and so on.
There should be possibility for setting all locale categories from KControl, 
still using setlocale if possible (this way we can make use of locale 
aliasing).
Having only some possibilities to choose from (as it is done now) is also not 
a good idea, as someone may have "mars_MARS.STRANGE-charset" locale defined, 
and he may want to use it.

Greets,
     Jacek
-- 
+---------+--------------------------------------------------------+
!      ,  !            Jacek Konieczny, Gliwice, Poland            !      
! Jajcus  ! email: jajcus@zeus.polsl.gliwice.pl, jajcus@polbox.com !
!         ! ICQ# 7149127                           WWW: none (yet) !
+---------+--------------------------------------powered-by-Linux--+

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic