Files
libguestfs/po-docs/Makefile.am
Pino Toscano bd896d68c0 po-docs: split pot and po handling
With the Weblate adoption, we let it update the po files from the
catalog template. The po4a behaviour of extracting the template,
merging the existing translations, and creating the translated PODs at
once is problematic. Hence, split the extraction and the translated POD
generation in two.

Use po4a-gettextize to extract the catalog template only, not doing it
anymore automatically at each build. There is no more need for a
po4a.conf file.

Use po4a-translate to create translated PODs from the po files, keeping
the fixup of the generated files (to avoid spurious =encoding, etc).
Add a silent rule to hide the po4a-translate command lines by default.

These changes also allow us to get rid of the POD existance checks with
associated error message pointing to the update-po rule. Now each
translated POD file is generated because of make dependency, and it
depends only on its po file.

Signed-off-by: Pino Toscano <ptoscano@redhat.com>
2020-08-13 11:27:44 +02:00

66 lines
2.2 KiB
Makefile

# libguestfs translations of man pages and POD files
# Copyright (C) 2010-2012 Red Hat Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
include $(top_srcdir)/subdir-rules.mk
# XXX The use of po4a is naive here. Also we should integrate this
# into the po/ directory and the translations into the usual
# libguestfs.pot file.
# Languages that we translate.
# Don't use LINGUAS (uppercase) as Gentoo defines it (RHBZ#804464).
linguas = ja uk
# Languages that we have PO files for, but we don't translate
# because there is insufficient coverage.
linguas_not_translated = cs de en_GB es eu fr nl pt_BR tg zh_CN
EXTRA_DIST = \
libguestfs-docs.pot \
$(linguas:%=%.po) \
$(linguas_not_translated:%=%.po) \
podfiles
# Build the final man pages from the translated POD files. Each
# language directory contains a Makefile.am that we need to keep up to
# date (note each $lang/Makefile.am should be identical).
# XXX Is there a better way?
SUBDIRS = $(linguas)
libguestfs-docs.pot:
$(PO4A_GETTEXTIZE) \
-f pod \
-M utf-8 -L utf-8 \
--package-name $(PACKAGE_NAME) \
--package-version $(PACKAGE_VERSION) \
--msgid-bugs-address libguestfs@redhat.com \
--copyright-holder "Red Hat Inc." \
-p $@ \
$(patsubst %,-m %,$(shell cat $(srcdir)/podfiles))
podfiles: Makefile
rm -f $@ $@-t
find $(top_srcdir) -name '*.pod' | \
grep -v /debian/ | \
grep -v /libguestfs-1 | \
grep -v /po-docs/ | \
grep -v /stamp- \
> $@-t
for f in `cat $(top_srcdir)/po/POTFILES-pl`; do echo $(top_srcdir)/$$f; done >> $@-t
LC_ALL=C sort -o $@-t $@-t
mv $@-t $@