docs: restore po4a config + optional cmake po4a-update target - #485
Merged
Conversation
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.
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.
Summary
PR #466 retired the autotools surface and, alongside it, deleted
docs/man/po4a.config(rationale given there: "only used bydocs/man/Makefile.am"). The.po/.potfiles underdocs/man/po/and the committed*.LANG.1manpages 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
.pofiles 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
docs/man/po4a.configxasline (xas was deleted in #466)docs/man/CMakeLists.txtfind_program(PO4A_EXECUTABLE po4a); when found, define apo4a-updatecustom targetdocs/INSTALLcmake --build build --target po4a-updateTotal: +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 po4aagainst the pre-#466 tree shows the only references in build glue are:docs/man/po4a.configitself,docs/man/Makefile.am: EXTRA_DIST += po4a.config— ships the file in source tarballs, no rule invokes it,*.LANG.1files.There's no
AC_CHECK_PROG(po4a), noAM_CONDITIONAL, no automake rule, no Makefile recipe that runspo4a. Translators ranpo4a po4a.configby hand and committed the regenerated artifacts. This PR keeps that workflow: the*.LANG.1files remain the source of truth forinstall, andpo4a-updateis 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):
The target invokes
po4a po4a.configwith the working directory set todocs/man/, matching what a translator would run by hand. When the committed.poand English.1files 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 rewritesmanpages.pot, syncs eachmanpages-LANG.po, and regenerates the corresponding*.LANG.1files — and the translator commits the result.Test plan
cmake --build build --target po4a-updatesucceeds.build/docs/man/Makefile).po4a.configmatches the pre-cleanup: retire autotools, debian/, and dead platform/subtool trees #466 file with only thexasline removed (git show 337e236fb^:docs/man/po4a.configdiff).