Skip to content

po: adopt --no-wrap policy for all translation catalogs - #61

Merged
got3nks merged 2 commits into
amule-org:masterfrom
got3nks:feat/po-no-wrap-policy
Jun 10, 2026
Merged

po: adopt --no-wrap policy for all translation catalogs#61
got3nks merged 2 commits into
amule-org:masterfrom
got3nks:feat/po-no-wrap-policy

Conversation

@got3nks

@got3nks got3nks commented Jun 10, 2026

Copy link
Copy Markdown

Summary

Adopts --no-wrap as the project-wide formatting policy for all translation catalogs, following the discussion in #59 (@ngosang, @mrjimenez, me — all in agreement). The default 77-char wrap is a TTY-era convention; nobody hand-edits raw .po files anymore for a Weblate-managed project, and the wrap mostly buries real translation changes under reflow noise — PR #59's own diff is the canonical example.

This PR makes the switch coherent end-to-end on the repo side. The remaining piece — flipping the Weblate components to "Do not wrap long lines" — is on @ngosang after this lands.

Rebased onto master after #60. The pre-#60 version of this PR had identical scope and content.

Tooling changes (commit 1, +24/-7)

  • scripts/update-po.sh — pass --no-wrap to xgettext and msgmerge, and rewrite each .po via --output-file=$tmp && mv $tmp $orig instead of --update. msgmerge --update treats a .po as up-to-date when only the pot's wrap (not its content) has changed and silently skips rewriting, which defeats --no-wrap on any catalog previously committed in wrapped form. The tempfile pattern always rewrites.
  • po/Makevars — add --no-wrap to XGETTEXT_OPTIONS for symmetry with the legacy autotools update-po target (CMake doesn't currently invoke it, but the values stay consistent).
  • docs/man/po4a.config — add --wrap-po no to the global [options] line; po4a's equivalent of gettext's --no-wrap for the manpages catalogs. Rendered .1.in output is unaffected (po4a's content reflow is governed by --width, which we don't touch).
  • .github/workflows/i18n.yml pot-sync drift check — simplify the comparison normalisation from msgcat --width=79 to msgcat --no-wrap. The check stays wrap-policy-agnostic by design (it normalises both sides), but --no-wrap now matches the policy and is one knob simpler.

One-shot normalisation (commit 2, +7626/-21227)

Regenerated po/amule.pot + all po/*.po with the new script (bulk of the diff). Each msgid/msgstr collapses from multi-line continuation strings to a single line. No translations gained or lost, no fuzzy or obsolete markings introduced. The docs/man/po/manpages-*.po files were already in no-wrap-equivalent form on master, so only docs/man/po/manpages.pot was rewritten by the po4a pass; no rendered .1.in file changed.

Drive-by: po/gl.po was 100755 on master (the only .po with the executable bit set, an old accidental mode). The regen writes through a tempfile + mv and reseats it to 100644, matching every other catalog.

The drift check (msgcat --no-wrap, strip volatile headers + #: source refs) passes cleanly across all catalogs locally.

Test plan

  • CI green on this branch (pofiles, pot-sync, manpages-sync).
  • After merge: @ngosang flips Weblate's application + application-man-pages components to "Do not wrap long lines"; next bot PR should be content-only.

@got3nks

got3nks commented Jun 10, 2026

Copy link
Copy Markdown
Author

@ngosang I will wait for your green signal before merging.

@mrjimenez

Copy link
Copy Markdown

I think #60 Introduced conflicts.

got3nks added 2 commits June 10, 2026 17:43
Adopt --no-wrap as the project-wide formatting policy for translation
catalogs, per the discussion in amule-project#59. xgettext / msgmerge / po4a /
msgcat all get the appropriate equivalent flag so a local regen
produces no-wrap output and the CI drift check normalises the same
way.

The pot-sync drift comparison in i18n.yml stays wrap-policy-agnostic
by design (it normalises both sides through msgcat first); switching
from --width=79 to --no-wrap just aligns the knob with the policy.

The companion one-shot regeneration of po/*.po and the pot files
follows in the next commit.
Output of ./scripts/update-po.sh + (cd docs/man && touch po/manpages-*.po
&& po4a po4a.config) with the new --no-wrap tooling defaults from the
previous commit. Formatting-only change: each msgid/msgstr collapses
from multi-line continuation strings to a single line. No translations
gained or lost, no fuzzy or obsolete markings introduced, and the
rendered docs/man/*.1.in / src/utils/**/*.1.in files are unchanged.

docs/man/po/manpages-*.po were already in no-wrap-equivalent form on
master, so on the manpages side only docs/man/po/manpages.pot is
touched.

Drive-by: po/gl.po was 100755 on master (the only .po file with the
executable bit set, an old accidental mode). The regen writes through
a tempfile + mv and reseats it to 100644, matching every other catalog.
@got3nks
got3nks force-pushed the feat/po-no-wrap-policy branch from 99b1aae to ede3644 Compare June 10, 2026 15:44
@got3nks

got3nks commented Jun 10, 2026

Copy link
Copy Markdown
Author

I think #60 Introduced conflicts.

Yes I know, fixed. ;)

@got3nks
got3nks merged commit 53a4b78 into amule-org:master Jun 10, 2026
9 checks passed
@ngosang

ngosang commented Jun 10, 2026

Copy link
Copy Markdown
Member

Go go go!

@got3nks
got3nks deleted the feat/po-no-wrap-policy branch June 10, 2026 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants