Skip to content

Commit f65bd47

Browse files
gemmaroFlorian Pelz
authored and
Florian Pelz
committed
build: Use the po4a command for the translation generation.
* configure.ac (Documentation translation): Remove the po4a-translate command. This command has been replaced by the po4a command and are not used from anywhere. * doc/local.mk ($(srcdir)/%D%/guix.%.texi, $(srcdir)/%D%/guix-cookbook.%.texi) ($(srcdir)/%D%/contributing.%.texi): Use the po4a command instead of the po4a-translate for the translation generation. This eliminates the warning of po4a-translate; "po4a-translate is deprecated. The unified po4a(1) program is more convenient and less error prone." (PO4A_PARAMS): Remove the Texinfo format option. This option is specified in the configuration file (po/doc/po4a.cfg). (dummy_pot): Add a variable for the temporary POT file location. Change-Id: I542b934c3c03b8701e9f86823191224f8b0ccf81 Signed-off-by: Florian Pelz <[email protected]>
1 parent 2d4af52 commit f65bd47

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

configure.ac

-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ AM_MISSING_PROG([HELP2MAN], [help2man])
265265

266266
dnl Documentation translation.
267267
AM_MISSING_PROG([PO4A], [po4a])
268-
AM_MISSING_PROG([PO4A_TRANSLATE], [po4a-translate])
269268

270269
AC_MSG_CHECKING([if building from git])
271270
if test -e .git; then

doc/local.mk

+23-7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# Copyright © 2018, 2021 Julien Lepiller <[email protected]>
88
# Copyright © 2019 Timothy Sample <[email protected]>
99
# Copyright © 2024 Janneke Nieuwenhuizen <[email protected]>
10+
# Copyright © 2024 gemmaro <[email protected]>
1011
#
1112
# This file is part of GNU Guix.
1213
#
@@ -89,10 +90,6 @@ BUILT_SOURCES += $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO)
8990
EXTRA_DIST += $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO)
9091
MAINTAINERCLEANFILES = $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO)
9192

92-
PO4A_PARAMS := -M UTF-8 -L UTF-8 #master and localized encoding
93-
PO4A_PARAMS += -k 0 # produce an output even if the translation is not complete
94-
PO4A_PARAMS += -f texinfo # texinfo format
95-
9693
# When a change to guix.texi occurs, it is not translated immediately.
9794
# Because @pxref and @xref commands are references to sections by name, they
9895
# should be translated. If a modification adds a reference to a section, this
@@ -104,20 +101,39 @@ $(top_srcdir)/pre-inst-env $(GUILE) --no-auto-compile \
104101
$@.tmp $<
105102
endef
106103

104+
# If /dev/null is used for this POT file path, a warning will be issued
105+
# because the path extension is not 'pot'.
106+
dummy_pot = $(shell mktemp --suffix=.pot)
107+
107108
$(srcdir)/%D%/guix.%.texi: po/doc/guix-manual.%.po $(srcdir)/%D%/contributing.%.texi guix/build/po.go
108-
-$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/guix.texi" -p "$<" -l "$@.tmp"
109+
-$(AM_V_PO4A)$(PO4A) --no-update \
110+
--variable localized="$@.tmp" \
111+
--variable master="%D%/guix.texi" \
112+
--variable po="$<" \
113+
--variable pot=$(dummy_pot) \
114+
po/doc/po4a.cfg
109115
-sed -i "s|guix\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp"
110116
-$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command)
111117
-mv "$@.tmp" "$@"
112118

113119
$(srcdir)/%D%/guix-cookbook.%.texi: po/doc/guix-cookbook.%.po guix/build/po.go
114-
-$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/guix-cookbook.texi" -p "$<" -l "$@.tmp"
120+
-$(AM_V_PO4A)$(PO4A) --no-update \
121+
--variable localized="$@.tmp" \
122+
--variable master="%D%/guix-cookbook.texi" \
123+
--variable po="$<" \
124+
--variable pot=$(dummy_pot) \
125+
po/doc/po4a.cfg
115126
-sed -i "s|guix-cookbook\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp"
116127
-$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command)
117128
-mv "$@.tmp" "$@"
118129

119130
$(srcdir)/%D%/contributing.%.texi: po/doc/guix-manual.%.po guix/build/po.go
120-
-$(AM_V_PO4A)$(PO4A_TRANSLATE) $(PO4A_PARAMS) -m "%D%/contributing.texi" -p "$<" -l "$@.tmp"
131+
-$(AM_V_PO4A)$(PO4A) --no-update \
132+
--variable localized="$@.tmp" \
133+
--variable master="%D%/contributing.texi" \
134+
--variable po="$<" \
135+
--variable pot=$(dummy_pot) \
136+
po/doc/po4a.cfg
121137
-$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command)
122138
-mv "$@.tmp" "$@"
123139

po/doc/local.mk

-5
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@ EXTRA_DIST = \
4040
$(DOC_PO_FILES) \
4141
$(DOC_COOKBOOK_PO_FILES)
4242

43-
POT_OPTIONS = \
44-
--package-name "guix manual" --package-version "$(VERSION)" \
45-
--copyright-holder "the authors of Guix (msgids)" \
46-
--msgid-bugs-address "[email protected]"
47-
4843
%D%/%.pot: $(srcdir)/doc/%.texi
4944
$(AM_V_PO4A)$(PO4A) --no-translations -M UTF-8 \
5045
--package-version "$(VERSION)" \

0 commit comments

Comments
 (0)