Skip to content

docs: restore po4a config + optional cmake po4a-update target - #485

Merged
mrjimenez merged 1 commit into
amule-project:masterfrom
got3nks:restore-po4a-cmake
Apr 27, 2026
Merged

docs: restore po4a config + optional cmake po4a-update target#485
mrjimenez merged 1 commit into
amule-project:masterfrom
got3nks:restore-po4a-cmake

Conversation

@got3nks

@got3nks got3nks commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Summary

PR #466 retired the autotools surface and, alongside it, deleted docs/man/po4a.config (rationale given there: "only used by docs/man/Makefile.am"). The .po / .pot files under docs/man/po/ and the committed *.LANG.1 manpages were kept, but the driver that lets translators refresh them was lost.

As @Vollstrecker pointed out in #466 (comment), po4a is not autotools-related — it's a standalone manpage translation tool that lets translators familiar with .po files keep manpage translations in sync with the English masters. Worth keeping.

This PR restores the workflow under CMake without making po4a a build dependency.

What changed

file change
docs/man/po4a.config restored verbatim from pre-#466, minus the xas line (xas was deleted in #466)
docs/man/CMakeLists.txt find_program(PO4A_EXECUTABLE po4a); when found, define a po4a-update custom target
docs/INSTALL brief maintainer/translator note pointing at cmake --build build --target po4a-update

Total: +43 lines, 1 new file.

Why a translator-only target (and not a build step)

po4a was never wired into the default build under autotools either. git grep po4a against the pre-#466 tree shows the only references in build glue are:

  • docs/man/po4a.config itself,
  • docs/man/Makefile.am: EXTRA_DIST += po4a.config — ships the file in source tarballs, no rule invokes it,
  • header comments in the generated *.LANG.1 files.

There's no AC_CHECK_PROG(po4a), no AM_CONDITIONAL, no automake rule, no Makefile recipe that runs po4a. Translators ran po4a po4a.config by hand and committed the regenerated artifacts. This PR keeps that workflow: the *.LANG.1 files remain the source of truth for install, and po4a-update is the regen helper.

When po4a is absent on the host, the target simply isn't created — no configure error, no CI impact.

Verification

On macOS (po4a 0.74 from Homebrew):

cmake -B build -DBUILD_MONOLITHIC=YES -DBUILD_REMOTEGUI=YES
cmake --build build --target po4a-update
# [100%] Refreshing translated manpages via po4a
# [100%] Built target po4a-update

The target invokes po4a po4a.config with the working directory set to docs/man/, matching what a translator would run by hand. When the committed .po and English .1 files are in mutual equilibrium (current state), po4a is a no-op. When they aren't (e.g., a translator updates a .po, or someone edits an English master), the target rewrites manpages.pot, syncs each manpages-LANG.po, and regenerates the corresponding *.LANG.1 files — and the translator commits the result.

Test plan

  • Configure with po4a installed — target appears, cmake --build build --target po4a-update succeeds.
  • Configure with po4a absent — no error, target simply doesn't exist (verified by reading the generated build/docs/man/Makefile).
  • Confirmed the restored po4a.config matches the pre-cleanup: retire autotools, debian/, and dead platform/subtool trees #466 file with only the xas line removed (git show 337e236fb^:docs/man/po4a.config diff).

PR amule-project#466 retired the autotools surface and, alongside it, deleted
docs/man/po4a.config (only used by docs/man/Makefile.am). The .po /
.pot files in docs/man/po/ and the committed *.LANG.1 manpages were
kept, but the driver that lets translators refresh them was lost.

po4a was never wired into the default build (autotools or otherwise);
the autotools tree only EXTRA_DIST'd po4a.config. Translators ran
'po4a po4a.config' out-of-band and committed the regenerated
*.LANG.1 files. This change restores that workflow without making
po4a a build dependency.

- docs/man/po4a.config: restored verbatim from the pre-PR-466 tree,
  with the xas entry dropped (xas itself was removed in amule-project#466).
- docs/man/CMakeLists.txt: find_program(po4a). When found, add an
  optional 'po4a-update' custom target that invokes
  'po4a po4a.config' from docs/man/. When po4a is absent, the
  target simply isn't generated -- no configure error, no impact
  on CI.
- docs/INSTALL: short maintainer note pointing at
  'cmake --build build --target po4a-update'.

Verified on macOS (po4a 0.74 from Homebrew): configure discovers
po4a, 'cmake --build build --target po4a-update' runs the same
'po4a po4a.config' invocation translators would run by hand, and
regenerates the *.LANG.1 / *.po / .pot files in place when their
content has drifted from the English masters.
@mrjimenez
mrjimenez merged commit fab6600 into amule-project:master Apr 27, 2026
9 checks passed
@got3nks
got3nks deleted the restore-po4a-cmake branch May 3, 2026 15:19
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.

2 participants