This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[SOLVED] Localize an applet

Tags: None
(comma "," separated)
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
19765
Karma
87
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]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
19765
Karma
87
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]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 !


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]