From kde-devel Thu Oct 04 08:25:27 2001 From: Matthias Hoelzer-Kluepfel Date: Thu, 04 Oct 2001 08:25:27 +0000 To: kde-devel Subject: Re: KLocale::language() X-MARC-Message: https://marc.info/?l=kde-devel&m=100218364219458 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 <<