[rkward-devel] News on plugin i18n
Thomas Friedrichsmeier
thomas.friedrichsmeier at ruhr-uni-bochum.de
Sat Nov 29 12:38:22 UTC 2014
Hi!
Ok, I did make some more progress on plugin i18n (but still trying to figure
out how to integrate best with KDE's translation infrastructure[1]). Here's
some of the more important bits:
1. The message extraction script is finally complete (I think), although my
statement from end of October that it would not get too much more complex was
a bit premature...
On the upside it will also do some things that I had not originally thought of
including. Basically, all you have to do now (for external plugins) is:
scripts/update_plugin_messages.py my.pluginmap
On the first run this will create the .pot-file (and it will be in folder "po"
next to your pluginmap). Place any translations (.po-files) next to it. Then
run the script again to update extracted messages, merge with the
translations, compile the translations and copy them to their destination dirs
below "po".
2. Actually marking all relevant strings for i18n in the .js files is as
cumbersome as I had feared, and then some. I've completed most of
analysis.pluginmap, but there is a whole lot of work left to be done on the
other plugins.
3. But as I was getting frustrated with all that header-pasting, I
had an idea to make that particular part much easier, and cleaner.
You can now write (in .js):
new Header (i18n ("Some analysis"))
.add (i18n ("Some parameter"), i18n ("some value"))
.print ();
Better yet, suppose "Some parameter" is controlled by a radio-element (with id
"radio_id"), and essentially you just want to copy the setting from the UI for
documenting it in the header, you can now do:
new Header (i18n ("Some analysis")).addFromUI ("radio_id").print ();
Regards
Thomas
[1] http://lists.kde.org/?l=kde-i18n-doc&m=141700741608249&w=2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20141129/b99df25b/attachment.sig>
More information about the Rkward-devel
mailing list