2020-02-07 13:32:21 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
#############################################################################
|
|
|
|
#
|
|
|
|
# Updates xz-man.pot and the *.po files, and generates translated man pages.
|
|
|
|
# These are done using the program po4a. If po4a is missing, it is still
|
|
|
|
# possible to build the package without translated man pages.
|
|
|
|
#
|
|
|
|
#############################################################################
|
|
|
|
#
|
|
|
|
# Author: Lasse Collin
|
|
|
|
#
|
|
|
|
# This file has been put into the public domain.
|
|
|
|
# You can do whatever you want with this file.
|
|
|
|
#
|
|
|
|
#############################################################################
|
|
|
|
|
|
|
|
if type po4a > /dev/null 2>&1; then
|
|
|
|
:
|
|
|
|
else
|
|
|
|
echo "po4a/update-po: The program 'po4a' was not found." >&2
|
|
|
|
echo "po4a/update-po: Translated man pages were not generated." >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test ! -f po4a.conf; then
|
|
|
|
cd `dirname "$0"` || exit 1
|
|
|
|
if test ! -f po4a.conf; then
|
|
|
|
echo "update-po: Error: Cannot find po4a.conf." >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
PACKAGE_VERSION=`cd .. && sh build-aux/version.sh` || exit 1
|
|
|
|
|
|
|
|
# Using --force to get up-to-date version numbers in the output files
|
|
|
|
# when nothing else has changed. This makes it slower but it's fine
|
|
|
|
# as long as this isn't run every time when "make" is run at the
|
|
|
|
# top level directory. (po4a isn't super-fast even without --force).
|
2024-05-27 22:17:45 +00:00
|
|
|
#
|
|
|
|
# Using --porefs file and --msgmerge-opt '--add-location=file' make diffing
|
|
|
|
# the .pot and .po files easier. If a translator prefers to have the line
|
|
|
|
# numbers available, one may delete those options and rerun this script.
|
2024-05-28 10:25:07 +00:00
|
|
|
#
|
|
|
|
# The values from --package-name and --package-version are used to create
|
|
|
|
# the Project-Id-Version field. It likely makes sense that its value isn't
|
|
|
|
# identical to the value in the program message translations. In practice
|
|
|
|
# it seems that the .po files from many (but not all) translators will use
|
|
|
|
# "xz-man" no matter what is specified here and in xz-man.pot. Thus it's
|
|
|
|
# best to use "xz-man" here to get the most consistent results.
|
2020-02-07 13:32:21 +00:00
|
|
|
set -x
|
|
|
|
po4a --force --verbose \
|
2024-05-27 22:17:45 +00:00
|
|
|
--porefs file --msgmerge-opt '--add-location=file' \
|
2024-05-28 10:25:07 +00:00
|
|
|
--package-name="xz-man" \
|
2020-02-07 13:32:21 +00:00
|
|
|
--package-version="$PACKAGE_VERSION" \
|
2022-07-25 16:11:05 +00:00
|
|
|
--copyright-holder="[See the headers in the input files.]" \
|
2020-02-07 13:32:21 +00:00
|
|
|
po4a.conf
|