]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
po4a/update-po: Disable wrapping in .pot and .po files
authorLasse Collin <lasse.collin@tukaani.org>
Tue, 28 May 2024 18:10:33 +0000 (21:10 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Tue, 28 May 2024 18:20:55 +0000 (21:20 +0300)
The .po files from the Translation Project come with unwrapped
strings so this matches it.

This may reduce the noise in diffs too. When the beginning of
a paragraph had changed, the rest of the lines got rewrapped
in msgsid. Now it's just one very long line that changes when
a paragraph has been edited.

The --add-location=file option was removed as redundant. The line
numbers don't exist in the .pot file due to --porefs file and thus
they cannot get copied to the .po files either.

(cherry picked from commit 4beba1cd62d7f8f7a6f1e899b68292d94c53b599)

po4a/update-po

index 689c76027eb28e2a9bbe9ad8b101dcfdb7da6ba3..902af56b8805d2f6336e813573b4320f76aeb208 100755 (executable)
@@ -38,9 +38,16 @@ PACKAGE_VERSION=`cd .. && sh build-aux/version.sh` || exit 1
 # 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).
 #
-# 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.
+# Make diffing the .pot and .po files easier:
+#
+#   --porefs file       Put only the input filenames, not line numbers,
+#                       into the .pot file. This way they won't get
+#                       copied to the .po files either.
+#
+#   --wrap-po newlines  Wrap msgids only at \n in the .pot file.
+#
+#   --msgmerge-opt "--no-wrap"
+#                       Wrap msgids and msgstrs only at \n in the .po files.
 #
 # 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
@@ -50,7 +57,7 @@ PACKAGE_VERSION=`cd .. && sh build-aux/version.sh` || exit 1
 # best to use "xz-man" here to get the most consistent results.
 set -x
 po4a --force --verbose \
-       --porefs file --msgmerge-opt '--add-location=file' \
+       --porefs file --wrap-po newlines --msgmerge-opt "--no-wrap" \
        --package-name="xz-man" \
        --package-version="$PACKAGE_VERSION" \
        --copyright-holder="[See the headers in the input files.]" \