Dnia Tuesday 26 of July 2005 02:32, David Faure napisa=B3:
> On Tuesday 26 July 2005 01:31, Tomasz Grobelny wrote:
> > Is it possible to get locale settings for a given language? For example=

I
> > want to format date in English while my current locale is Polish. If
> > there is no appropriate function would such a code be safe (if it works
> > at all): QString oldlang=3DKGlobal::locale()->language();
> > KGlobal::locale()->setLanguage("en");
> > QString dateInEnglish=3DKGlobal::locale()->formatDate(qdate);
> > KGlobal::locale()->setLanguage(oldlang);

>
> This isn't C, no need to set/reset a global state when you can instanciate
> a class ;-)
>

I felt it was not the best solution, that's why I asked. BTW, see =

kdepim/libkmime/kmime_util.cpp:715

> KLocale englishLanguage("en");
> QString dateInEnglish =3D englishLanguage.formatDate(qdate);
>
> should work.

But it doesn't. Neither does my (previous) code. I have withhen sth like th=
is:
KLocale polishLanguage("pl_PL"); //"pl" doesn't work either
ret =3D polishLanguage.formatDateTime(qdate, shortFormat, includeSecs);
kdDebug()< and I got this:
kmail: pl Monday 25 of July 2005 10:38 en_US

Tomek
=

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscrib=

e <<