Translating scripted applets

Petri Damstén petri.damsten at gmail.com
Fri May 29 07:25:40 CEST 2009


Hi,

Continuing testing python applets and trying to get translations working. I 
tried contents/locale/fi/LC_MESSAGES/pluginname.mo but it didn't work before I 
added following code. Is this correct fix or should I use something else for 
po file names?

Petri

Index: applet.cpp
@@ -2271,6 +2275,7 @@
         //FIXME: we should _probably_ use a KComponentData to segregate the 
applets
         //       from each other; but I want to get the basics working first 
:)
         KGlobal::dirs()->addResourceDir("locale", translationsPath);
+        KGlobal::locale()->insertCatalog(package->metadata().pluginName());
     }

     QString xmlPath = package->filePath("mainconfigxml");

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20090529/f62f8189/attachment.sig 


More information about the Plasma-devel mailing list