Translation support in Qt-translation-based frameworks

Aurélien Gâteau agateau at kde.org
Tue Apr 1 08:07:37 UTC 2014


[sinp]
> > To test translations:
> > 
> > 1. Generate a .pot file by following those instructions:
> > http://techbase.kde.org/Development/Tutorials/Localization/i18n_Build_System
> > s#Testing_your_Messages.sh_script
> > 
> > 2. Create a translation file:
> >     cd po
> >     cp myframework.pot myframework-fr.po
> >     (or -de, -es, -pt...)
> > 
> > 3. Edit myframework-fr.po with Lokalize or your text editor, translate
> > strings of interest (no need to translate all, this is just for testing)
> > 
> > 4. Rerun cmake so that it notices the new po dir (touch CMakeLists.txt
> > should do)
> > 
> > 5. Run make and make install
> > 
> > 6. Run the code to test, your translations should appear
> 
> This is really bad compared to our you do it in kde4 which is basically.
>  * Go do l10n-kde4
>  * Install your language
>  * Done

True.

> It also makes it much harder for translators to test the translations
> they are 
> working on since they suddenly have to compile the program they are 
> translating instead of just compiling the translation and using the
> binaries 
> the distro provides.

Even in the current state, I think it would still work: distro would
ship packages built from tarballs which contain translations, so the
code would load any updated translation. In any case, such a testing
workflow is broken, IMO: you want to test translations of version N of
the app with code of version N, not version N - 1.

Having said that, it is a problem when testing packages for nightly
builds (a much better way to test translations), which I assume are not
built from tarballs with translations.
 
> Any way we can make the old "just compile your l10n-kde4 language and
> install 
> it" way work?

The cmake code can be changed to always build the .qm loader. This way
you can build the .qm separately. It would still require the step
"compile your l10n-kde4 language and install" to know that this
particular .po needs to be turned into a .qm, not a .mo. Any ideas how
to do that?

Aurélien


More information about the Kde-frameworks-devel mailing list