KLocale and rejecting languages if the application is not translated

Aaron J. Seigo aseigo at kde.org
Sun Jan 4 05:07:28 GMT 2009


On Saturday 03 January 2009, Chusslove Illich wrote:
> > [: Aaron J. Seigo :]
> > the cause of the problem is that the desktop:/ ioslave has no
> > translatable strings (and is a QCoreApplication if that matters any?) and
> > therefore when setLanguage is called on KLocale upon construction when
> > calling KGlobal::locale(), the default local language is rejected.
>
> I'm dud on ioslaves, but those in kdelibs/kioslave/ which are in the same
> situation (no translation catalog of their own) point to an always existing
> catalog and jump-start locales right away:
>
>   // necessary to use other kio slaves
>   KComponentData("kio_desktop", "kdelibs4");

ah, because it is saying that kdelibs4 is its translation catalog. i wasn't 
sure if that was ok to do (lie about your catalog like that ;)

*thinks* and this is probably why it "works" for apps without translations, 
because they pull in kdelibs which pulls in the kdelibs4 catalog? which tells 
KLocale it's "ok" to use those other languages?

>   (void) KGlobal::locale();

is this line necessary? reading through the code and sprinkling debug here and 
there it seems that locale() will get called for you just fine.

> which did the trick for me for kio_desktop as well.

i already comitted a fix for it ...

it's a little sad that we need to do this over and over. hum.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090103/6224428d/attachment.sig>


More information about the kde-core-devel mailing list