build(po): extend the --no-wrap catalog policy to the manpage .po files - #67
Merged
Conversation
f6012ff adopted --no-wrap as the project-wide catalog formatting policy, but its po4a.config change (--wrap-po no) only covers the files written by po4a's internal PO writer -- in this flow, just po/manpages.pot. The per-language manpages-*.po are updated by po4a shelling out to GNU msgmerge (--previous --backup=none --update), which never sees any no-wrap flag, so any rewrite it performs comes back width-wrapped. --msgmerge-opt appends to the options po4a passes to msgmerge, so future content-changing merges now write no-wrap output, keeping the manpage catalogs aligned with the policy. This alone does not reformat the already-wrapped manpages-*.po: msgmerge --update treats a catalog as up-to-date when only wrapping differs and silently skips rewriting (the same pitfall f6012ff documented for scripts/update-po.sh). The one-shot normalisation follows in the next commit.
Output of running, for each catalog, the same msgmerge invocation
po4a now performs after the previous commit, but through a tempfile
instead of --update (which silently skips rewriting when only the
wrapping differs):
cd docs/man
for po in po/manpages-*.po; do
msgmerge --previous --no-wrap "$po" po/manpages.pot \
--output-file="$po.tmp" && mv "$po.tmp" "$po"
done
Formatting-only change: each wrapped msgid/msgstr collapses to a
single line. No translations gained or lost, no fuzzy or obsolete
markings introduced (msgfmt --statistics identical per catalog), and
a po4a render pass leaves docs/man/*.1.in / src/utils/**/*.1.in
byte-identical -- verified both locally and in a container replica
of the i18n.yml manpages-sync environment (noble + po4a 0.74-1).
This also corrects the record from 53a4b78, whose claim that the
manpages-*.po were "already in no-wrap-equivalent form" was wrong:
they were still width-wrapped at ~80 columns (62-68 multi-line
entries each), left behind because po4a updates them via msgmerge
--update, which never received a no-wrap flag and skips
formatting-only rewrites.
Closed
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
#59 adopted
--no-wrapas the project-wide formatting policy for translationcatalogs, and f6012ff + 53a4b78 switched the tooling and normalised
po/amule.pot+po/*.poaccordingly. However, the 10docs/man/po/manpages-*.powere left behind: they were still width-wrapped at~80 columns (62–68 multi-line entries each), despite 53a4b78's commit message
claiming they were "already in no-wrap-equivalent form".
The root cause (verified against the po4a 0.74 source): the
--wrap-po nooption added to
docs/man/po4a.configonly affects files written by po4a'sinternal PO writer — in this flow, just
po/manpages.pot. The per-language.pofiles are updated by po4a shelling out to GNUmsgmerge --previous --backup=none --update, which never receives any no-wrapflag. On top of that,
msgmerge --updatetreats a catalog as up-to-date whenonly the wrapping differs and silently skips rewriting — the same pitfall
f6012ff documented and fixed for
scripts/update-po.sh.Changes
docs/man/po4a.config: add--msgmerge-opt "--no-wrap"so that futurecontent-changing merges performed by po4a write no-wrap output.
One-shot normalisation of the 10
manpages-*.po, running the exactmsgmerge invocation po4a now performs, but through a tempfile instead of
--update(to defeat the formatting-only silent skip):Formatting-only: each wrapped msgid/msgstr collapses to a single line. From now
on, catalog diffs show real content changes instead of reflow noise, matching
the po/ catalogs and the Weblate configuration.
Verification
against the previous revision is empty; msgfmt --check --statistics is
identical before/after (246 translated in de/es/fr/it/pt_BR/tr; 222
translated + 7 fuzzy + 17 untranslated in hu/ro/ru/zh_TW).
docs/man/.1.in and src/utils/**/*.1.in untouched —
verified both locally and in a container replica of the CI manpages-sync
environment (Ubuntu noble + Debian po4a 0.74-1 + the same Perl deps), so the
i18n workflow stays green with no changes needed.
them (only the volatile POT-Creation-Date in the pot, not committed).