Support translation catalogs added in KDE Application release tarball
ClosedPublic

Authored by kossebau on Apr 29 2017, 12:10 AM.

Details

Summary

Starting with KDE Applications 17.04 the po files for the translations
are now added to the tarball of the sources they belong to, instead of
being released separately.
The release script also makes the assumption that all KDE Applications
use CMake, ECM and KI18n and simply inject the lines
ecm_install_po_files_as_qm(poqm)
ki18n_install(po)
to the end of the toplevel CMakeLists.txt.

Which does not work for Marble. To solve this, the release script
creating the KDE Applications tarballs gives Marble some special handling.

Additionally Marble's buildsystem needs to handle the case of Qt-only
building, where both macros are not available.

This patch solves this for now by using a custom macro for the po->qm files,
and (in a temporary hacky way) calling ki18n_install in a subdir
where the macro is known due to linking against KI18n and which will be
skipt in qt-only builds.

For that this patch moves the existing code for handling the
po->qm translations for the bundle packaging of marble-maps into the
global MarbleMacros.cmake file and adapts it, so it can be reused also
for the release tarball po->qm files.

Test Plan

Without po and poqm file build works as before.
Copied the po and poqm files from the released tarballs into the
toplevel dir, qm & mo files were created and installed as they should.

Custom bundle_translations target also works as before.

Diff Detail

Repository
R34 Marble
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kossebau created this revision.Apr 29 2017, 12:10 AM

Some additional notes from irc as background info:
[02:12] <tosky> is marble_install_po_files_as_qm a copy of ecm_qt_etcetc?
[02:14] <frinring> I wrote it from scratch, though then made it closer to ECM stuff, to ease any possible future switch to ECM
[02:15] <tosky> why not copy the other function then? Copy for copy, at least the behavior is exactly the same
[02:17] <frinring> tosky: not exactly, the marble macros e.g. take a TARGET parameter (needed for the existing bundle_translation target)
[02:18] <frinring> there are still some slight differences, otherwise I would agree.
[02:19] <tosky> nothintg that can end up into the ECM version?
[02:20] <frinring> tosky: perhaps. but I leave that extra mile for the next person. I just wanted to do a small favour here to help marble guys
[02:20] <frinring> which I am currently not, to keep concentrated :)
[02:21] <tosky> sure
[02:22] <frinring> I tried to make sure nothing prevents that, as I agree about the direction :)

aacid resigned from this revision.Apr 29 2017, 9:48 AM

I'm not really interested in the problems Marble has because they have decided to be non standard.

nienhueser accepted this revision.May 1 2017, 7:43 PM
This revision is now accepted and ready to land.May 1 2017, 7:43 PM
This revision was automatically updated to reflect the committed changes.