Country / Locale settings in non-KDE desktops/OS
Ralf Habacker
ralf.habacker at freenet.de
Fri Aug 28 10:52:02 BST 2009
John Layt schrieb:
> On Friday 28 August 2009 07:05:03 Ralf Habacker wrote:
>
>> John Layt schrieb:
>>
>>> 1) KLocale when it finds it doesn't have a Country configured should try
>>> find the Country of the host shell and load that in preference to C.
>>> QLocale::system().country() could give this, albeit with some futzing
>>> around as it returns an enum not the ISO code?
>>>
>> QLocale::system().name() returns 'de_DE' on my german windows installation.
>>
>> Ralf
>>
>
> I had seen that, but I wasn't sure if it would always return the second part
> for the country code, but that sounds promising if you do get it. Looking at
> the QLocale code it looks like it always does except for C or AnyCountry.
>
> There is also a 'helper' method in qlocale.cpp for:
> static QString countryToCode(QLocale::Country country)
> but I'm not sure we can use that?
>
The above mentioned method QLocale::name() uses this function to return
the country code after the '_'.
Regards
Ralf
> John.
>
More information about the kde-core-devel
mailing list