Moving Trojitá to extragear

Jan Kundrát jkt at flaska.net
Thu Nov 22 22:31:43 GMT 2012


It took quite a few hours, but it looks like I've tamed the beast.

I wanted to follow the way how Marble works, i.e. calling QObject::tr and converting between the .ts and .po files. This turned out to be a problem because QObject::tr expects the context to be a name of the class while the xgettext, as used by Messages.sh, works with file names. I have no idea how come that Marble's tr() calls work -- when I used the same, nothing would get translated.

The setup is documented at [1]. I've checked that the setup works locally (through running the extract-messages.sh script from kde-l10n-kde4's scripts); the message extraction depends on having access to `lupdate` and `ts2po`. How can I verify that the .po files for translators are generated?

To test by hand, follow these steps:

1) Set up the kde-l10n-kde4 repo [2]
2) Run `extract-messages.sh` from that repo while in Trojita's top-level directory. A new file called po/trojita_common.pot shall appear.
3) Either produce po/trojita_common_$LANG.po in your favorite tool, or get a sample translation [3]. Put it into the po/ directory.
4) Run qmake again. This is required because the globs are evaluated at qmake time, not at build time, AFAIK (pointers to how to "fix" that welcome).
5) Run `LC_ALL=cs_CZ.utf-8 ./src/Gui/trojita` and notice that the "View" menu is called "Zobrazit".
6) It works!

I believe that the localization has been taken care of by these changes (provided that the setup actually works and KDE's infrastructure/Scripty/whatever is OK with the scripts in my project). Albert, could you please confirm that this addresses the point you've raised?

(As an aside, it looks like my messages to this list go to the moderators' queue. That was surprising, but I assume it's by design. Are the reasons for that documented somewhere?)

Cheers,
Jan

[1] http://quickgit.kde.org/?p=trojita.git&a=blob&h=fadae711042660641391c2fccd6c7fa871d75de9&hb=5f7b9ada6306568d3c8652e3c5edb2700fdd91ed&f=po%2FREADME
[2] http://techbase.kde.org/Development/Tutorials/Localization/i18n_Build_Systems#What.27s_happening_behind_the_scenes
[3] http://dev.gentoo.org/~jkt/tmp/trojita_common_cs.po




More information about the kde-core-devel mailing list