Reply to topic

[SOLVED] Localize an applet

User avatar mdevlamynck
Registered Member
Posts
3
Karma
0
OS

[SOLVED] Localize an applet

Thu May 09, 2013 5:06 pm
Hi everyone,

I'm currently developping an applet, it's almost finished (i'll soon upload it) but I wanted to provide a french translation for it. The problem is I don't understand how to do it.

Must I create a lokalize project ? And then how do I get the list of string to translate ? Finally, how do I share the localization when sharing the applet ?

Last edited by mdevlamynck on Sat May 11, 2013 6:05 pm, edited 1 time in total.
User avatar bcooksley
Administrator
Posts
19759
Karma
86
OS

Re: Localize an applet

Fri May 10, 2013 6:59 am
The first step here is to extract your strings. Have you written a QML or C++ applet? It is also important that you invoked the correct functions to ensure the strings will be translated when the applet is used - with C++ at least this should be done through the i18n() function.


KDE Sysadmin
[img]http://forum.kde.org/content/bcooksley_sig.png[/img]
User avatar mdevlamynck
Registered Member
Posts
3
Karma
0
OS

Re: Localize an applet

Fri May 10, 2013 11:03 am
I have written a C++ applet, every string displayed is wrapped in a i18n call and I made the config ui with QtDesigner.
User avatar bcooksley
Administrator
Posts
19759
Karma
86
OS

Re: Localize an applet

Sat May 11, 2013 2:31 am
Okay. For advice here I would advise asking on the kde-devel@kde.org mailing list.
In essence it involves extracting the strings using gettext tools, and then translating the extracted strings.
Code: Select all
xgettext *.cpp -o $podir/filename.pot


Note however that with Plasma applets, the *.pot and *.po files needed to be named appropriately and installed in the right location to ensure they are loaded.


KDE Sysadmin
[img]http://forum.kde.org/content/bcooksley_sig.png[/img]
User avatar mdevlamynck
Registered Member
Posts
3
Karma
0
OS

Re: Localize an applet

Sat May 11, 2013 6:04 pm
Thanks for your answer, I search a bit about xgettext and I found this very usefull tutorial. I had to name the catalog plasma_applet_my-applet-name.so and it worked !

 
Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Exabot [Bot], Google [Bot], robertseetzen, Sogou [Bot], timescape, Xeno_Idaltu, Yahoo [Bot]