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

List:       kde-devel
Subject:    Re: KLocale::language()
From:       Matthias Hoelzer-Kluepfel <mhk () caldera ! de>
Date:       2001-10-04 8:25:27
[Download RAW message or body]

On Wednesday 03 October 2001 16:38, Takumi ASAKI wrote:
> Hi.
>
> I'm using KDE-2.2.1
> and I set Language & Country as
>     Country: Japan(jp)
>     Language: Japanese(ja)
>     Charset: jisx0208.1983-0
>
> I exec attached program, it returns
> ----------------------------------------
> jp
> C
> ja::ja_JP:ja_JP.eucJP:C
> ----------------------------------------
>
> Why does KLocale::language() return "C"?
> Why not "ja"?
>
> I want to get "ja".
> Should I check KLocale::Languages()?

Look at the documentation:

    /**
      * Returns the language used by this object. The domain AND the
      * library translation must be available in this language.
      * 'C' is default, if no other available.
      *
      * @return The currently used language.
      */
    QString language() const;

So if you don't have the japanese library translations installed, it will 
return "C". 

You can use 

QString lang = locale->languageList()[0];

if you are interested in what language would return if the translations would 
have been installed :)

Bye,
Matthias.
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

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

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