From 6ff8727a0641b299ac32bc897d3ac1246b02061e Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sun, 7 Aug 2016 15:52:59 +0200 Subject: CMake: Translations: Add support for shell scripts Rework the arguments to apt_add_translation_domain so a user can specify TARGETS and SCRIPTS, the latter being Shell scripts. For each language (TARGETS being C++, SCRIPTS being Shell), a separate template is generated via xgettext. Those templates are then merged together by using msgcomm. In case there are no Shell scripts in the translation domain, msgcomm will receive /dev/null instead of a shell translation template. This also reintroduces line numbers, as msgcomm would otherwise re-order the merged files not only by filename, but also by message string. It's unclear why it does that, it could just leave strings within a file alone. In contrast to the old build system, we use xgettext for shell scripts instead of bash --dump-strings, as it's just easier to use the same tool for everything. We also create valid headers. --- po/CMakeLists.txt | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) (limited to 'po/CMakeLists.txt') diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index dc3622156..c7dfcb0fb 100644 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -1,22 +1,28 @@ -apt_add_translation_domain(libapt-pkg${APT_PKG_MAJOR} apt-pkg) - -apt_add_translation_domain(apt # Domain - apt apt-cache apt-get apt-config apt-cdrom - apt-helper apt-mark - apt-private - # Methods - file copy store gpgv cdrom http https ftp rred rsh - mirror +apt_add_translation_domain( + DOMAIN libapt-pkg${APT_PKG_MAJOR} + TARGETS apt-pkg ) +apt_add_translation_domain( + DOMAIN apt + TARGETS apt apt-cache apt-get apt-config apt-cdrom apt-helper apt-mark + apt-private + # Methods + file copy store gpgv cdrom http https ftp rred rsh mirror + SCRIPTS ../dselect/install ../dselect/update +) -apt_add_translation_domain(apt-utils # Domain - apt-sortpkgs - apt-extracttemplates - apt-internal-solver - apt-dump-solver - apt-internal-planner - apt-ftparchive) +apt_add_translation_domain( + DOMAIN apt-utils + TARGETS apt-sortpkgs + apt-extracttemplates + apt-internal-solver + apt-dump-solver + apt-internal-planner + apt-ftparchive +) -# Add the translations for libapt-inst, and set the translation domain. -apt_add_translation_domain(libapt-inst${APT_INST_MAJOR} apt-inst) +apt_add_translation_domain( + DOMAIN libapt-inst${APT_INST_MAJOR} + TARGETS apt-inst +) -- cgit v1.2.3-70-g09d2