diff options
| -rw-r--r-- | configure.ac | 1 | ||||
| -rw-r--r-- | doc/local.mk | 30 | ||||
| -rw-r--r-- | po/doc/local.mk | 5 |
3 files changed, 23 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac index 7ef135c0a73..8a24a5cf0c7 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -265,7 +265,6 @@ AM_MISSING_PROG([HELP2MAN], [help2man]) | |||
| 265 | 265 | ||
| 266 | dnl Documentation translation. | 266 | dnl Documentation translation. |
| 267 | AM_MISSING_PROG([PO4A], [po4a]) | 267 | AM_MISSING_PROG([PO4A], [po4a]) |
| 268 | AM_MISSING_PROG([PO4A_TRANSLATE], [po4a-translate]) | ||
| 269 | 268 | ||
| 270 | AC_MSG_CHECKING([if building from git]) | 269 | AC_MSG_CHECKING([if building from git]) |
| 271 | if test -e .git; then | 270 | if test -e .git; then |
diff --git a/doc/local.mk b/doc/local.mk index 1d94e3c7583..389ca098bd0 100644 --- a/doc/local.mk +++ b/doc/local.mk | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | # Copyright © 2018, 2021 Julien Lepiller <julien@lepiller.eu> | 7 | # Copyright © 2018, 2021 Julien Lepiller <julien@lepiller.eu> |
| 8 | # Copyright © 2019 Timothy Sample <samplet@ngyro.com> | 8 | # Copyright © 2019 Timothy Sample <samplet@ngyro.com> |
| 9 | # Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org> | 9 | # Copyright © 2024 Janneke Nieuwenhuizen <janneke@gnu.org> |
| 10 | # Copyright © 2024 gemmaro <gemmaro.dev@gmail.com> | ||
| 10 | # | 11 | # |
| 11 | # This file is part of GNU Guix. | 12 | # This file is part of GNU Guix. |
| 12 | # | 13 | # |
| @@ -89,10 +90,6 @@ BUILT_SOURCES += $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO) | |||
| 89 | EXTRA_DIST += $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO) | 90 | EXTRA_DIST += $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO) |
| 90 | MAINTAINERCLEANFILES = $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO) | 91 | MAINTAINERCLEANFILES = $(OS_CONFIG_EXAMPLES_TEXI) $(TRANSLATED_INFO) |
| 91 | 92 | ||
| 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 | |||
| 96 | # When a change to guix.texi occurs, it is not translated immediately. | 93 | # When a change to guix.texi occurs, it is not translated immediately. |
| 97 | # Because @pxref and @xref commands are references to sections by name, they | 94 | # Because @pxref and @xref commands are references to sections by name, they |
| 98 | # should be translated. If a modification adds a reference to a section, this | 95 | # 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 \ | |||
| 104 | $@.tmp $< | 101 | $@.tmp $< |
| 105 | endef | 102 | endef |
| 106 | 103 | ||
| 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 | |||
| 107 | $(srcdir)/%D%/guix.%.texi: po/doc/guix-manual.%.po $(srcdir)/%D%/contributing.%.texi guix/build/po.go | 108 | $(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 | ||
| 109 | -sed -i "s|guix\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp" | 115 | -sed -i "s|guix\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp" |
| 110 | -$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command) | 116 | -$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command) |
| 111 | -mv "$@.tmp" "$@" | 117 | -mv "$@.tmp" "$@" |
| 112 | 118 | ||
| 113 | $(srcdir)/%D%/guix-cookbook.%.texi: po/doc/guix-cookbook.%.po guix/build/po.go | 119 | $(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 | ||
| 115 | -sed -i "s|guix-cookbook\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp" | 126 | -sed -i "s|guix-cookbook\.info|$$(basename "$@" | sed 's|texi$$|info|')|" "$@.tmp" |
| 116 | -$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command) | 127 | -$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command) |
| 117 | -mv "$@.tmp" "$@" | 128 | -mv "$@.tmp" "$@" |
| 118 | 129 | ||
| 119 | $(srcdir)/%D%/contributing.%.texi: po/doc/guix-manual.%.po guix/build/po.go | 130 | $(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 | ||
| 121 | -$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command) | 137 | -$(AM_V_POXREF)LC_ALL=en_US.UTF-8 $(xref_command) |
| 122 | -mv "$@.tmp" "$@" | 138 | -mv "$@.tmp" "$@" |
| 123 | 139 | ||
diff --git a/po/doc/local.mk b/po/doc/local.mk index 419898a1398..73d65a5bc4f 100644 --- a/po/doc/local.mk +++ b/po/doc/local.mk | |||
| @@ -40,11 +40,6 @@ EXTRA_DIST = \ | |||
| 40 | $(DOC_PO_FILES) \ | 40 | $(DOC_PO_FILES) \ |
| 41 | $(DOC_COOKBOOK_PO_FILES) | 41 | $(DOC_COOKBOOK_PO_FILES) |
| 42 | 42 | ||
| 43 | POT_OPTIONS = \ | ||
| 44 | --package-name "guix manual" --package-version "$(VERSION)" \ | ||
| 45 | --copyright-holder "the authors of Guix (msgids)" \ | ||
| 46 | --msgid-bugs-address "bug-guix@gnu.org" | ||
| 47 | |||
| 48 | %D%/%.pot: $(srcdir)/doc/%.texi | 43 | %D%/%.pot: $(srcdir)/doc/%.texi |
| 49 | $(AM_V_PO4A)$(PO4A) --no-translations -M UTF-8 \ | 44 | $(AM_V_PO4A)$(PO4A) --no-translations -M UTF-8 \ |
| 50 | --package-version "$(VERSION)" \ | 45 | --package-version "$(VERSION)" \ |
