Translation support in Qt-translation-based frameworks

Aurélien Gâteau agateau at kde.org
Wed Apr 2 14:42:07 UTC 2014


> > 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.
> 
> There is not such a thing as "tarballs with translations" at this stage,
> is there? Of course the frameworks tarballs should include their own
> translations IMHO but AFAIK this is still not done.

True. I have a task for this on the framework l10n wiki page

https://community.kde.org/Frameworks/Epics/KF5.0_Release_Preparation/l10n
> 
> > 
> > > 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. 
> 
> Which code?

There is a new function in ecm to build .qm files from the .po files and
generate a .cpp file to autoload the translation. I modified the root
CMakeLists.txt of all qt-based frameworks to use it if a "po" directory
exists.

I experimented with this today and made the function work even if the po
directory does not exist. In this case it only creates the .cpp file
(these changes have not been committed yet).
Having thought about it, I prefer it this way in all cases: I don't like
much the idea of having different code produced depending on whether the
po directory is there or not. Always generating the .cpp file feels
better.

> > 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?
> 
> If the .pot contains
> "X-Qt-Contexts: true\n"
> it's quite probable it needs it, the problem for that it's that you're
> going to need to have the templates folder besides your language folder
> My understanding is that .po files should still have this, but somehow
> the few files i found don't seem to have it :S
> 
> Not sure if it's because maybe they're autogenerated from other .po files

Sorry, I don't understand what you mean with the "templates folder".

Aurélien


More information about the Kde-frameworks-devel mailing list