1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
4 # This file is part of GNU Guix.
6 # GNU Guix is free software; you can redistribute it and/or modify it
7 # under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or (at
9 # your option) any later version.
11 # GNU Guix is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 %D
%/guix-manual.es.po \
21 %D
%/guix-manual.de.po \
22 %D
%/guix-manual.fr.po \
23 %D
%/guix-manual.ru.po \
24 %D
%/guix-manual.zh_CN.po
26 DOC_COOKBOOK_PO_FILES
= \
27 %D
%/guix-cookbook.de.po
31 %D
%/guix-cookbook.pot \
33 $(DOC_COOKBOOK_PO_FILES
)
35 POT_OPTIONS
= --package-name
"guix" --package-version
"$(VERSION)" \
36 --copyright-holder
"Ludovic Courtès" \
37 --msgid-bugs-address
"ludo@gnu.org"
40 @lang
=`echo "$@" | sed -e's/^doc-po-update-//'` ; \
41 output
="$(srcdir)/po/doc/guix-manual.$$lang.po" ; \
42 input
="$(srcdir)/po/doc/guix-manual.pot" ; \
43 if
test -f
"$$output"; then \
44 test "$(srcdir)" = .
&& cdcmd
="" || cdcmd
="cd $(srcdir) && "; \
45 echo
"$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $$output $$input"; \
47 && { case
`$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
48 '' |
0.
[0-9] |
0.
[0-9].
* |
0.1[0-7] |
0.1[0-7].
*) \
49 $(MSGMERGE_UPDATE
) $(MSGMERGE_OPTIONS
) "$$output" "$$input";; \
51 $(MSGMERGE_UPDATE
) $(MSGMERGE_OPTIONS
) --lang
=$${lang} "$$output" "$$input";; \
56 echo
"File $$output does not exist. If you are a translator, you can create it with 'msginit'." 1>&2; \
60 doc-po-update-cookbook-
%:
61 @lang
=`echo "$@" | sed -e's/^doc-po-update-cookbook-//'` ; \
62 output
="$(srcdir)/po/doc/guix-cookbook.$$lang.po" ; \
63 input
="$(srcdir)/po/doc/guix-cookbook.pot" ; \
64 if
test -f
"$$output"; then \
65 test "$(srcdir)" = .
&& cdcmd
="" || cdcmd
="cd $(srcdir) && "; \
66 echo
"$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $$output $$input"; \
68 && { case
`$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
69 '' |
0.
[0-9] |
0.
[0-9].
* |
0.1[0-7] |
0.1[0-7].
*) \
70 $(MSGMERGE_UPDATE
) $(MSGMERGE_OPTIONS
) "$$output" "$$input";; \
72 $(MSGMERGE_UPDATE
) $(MSGMERGE_OPTIONS
) --lang
=$${lang} "$$output" "$$input";; \
77 echo
"File $$output does not exist. If you are a translator, you can create it with 'msginit'." 1>&2; \
81 $(srcdir)/po
/doc
/%.pot-update
: doc
/%.texi
82 $(AM_V_PO4A
)$(PO4A_UPDATEPO
) -M UTF-8
-f texinfo
-m
"$<" \
83 -p
"$$(echo $@ | sed 's|-update||')" $(POT_OPTIONS
)
84 @touch
"$$(echo $@ | sed 's|-update||')"
86 TMP_POT_FILES
= contributing.pot guix.pot
89 for f in
$(TMP_POT_FILES
); do \
90 $(MAKE
) $(srcdir)/po
/doc
/guix.pot-update
; \
91 $(MAKE
) $(srcdir)/po
/doc
/contributing.pot-update
; \
93 $(MAKE
) $(srcdir)/po
/doc
/guix-cookbook.pot-update
;
94 msgcat
$(addprefix $(srcdir)/po
/doc
/, $(TMP_POT_FILES
)) > $(srcdir)/po
/doc
/guix-manual.pot
95 rm -f
$(addprefix $(srcdir)/po
/doc
/, $(TMP_POT_FILES
))
97 doc-po-update
: doc-pot-update
98 for f in
$(DOC_PO_FILES
); do \
99 lang
="`echo "$$f" | $(SED) -es'|.*/guix-manual\.\(.*\)\.po$$|\1|g'`"; \
100 $(MAKE
) "doc-po-update-$$lang"; \
102 for f in
$(DOC_COOKBOOK_PO_FILES
); do \
103 lang
="`echo "$$f" | $(SED) -es'|.*/guix-cookbook\.\(.*\)\.po$$|\1|g'`"; \
104 $(MAKE
) "doc-po-update-cookbook-$$lang"; \
108 .PHONY
: doc-po-update doc-pot-update