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.fa.po \
23 %D
%/guix-manual.fr.po \
24 %D
%/guix-manual.it.po \
25 %D
%/guix-manual.ko.po \
26 %D
%/guix-manual.pt_BR.po \
27 %D
%/guix-manual.ru.po \
28 %D
%/guix-manual.sk.po \
29 %D
%/guix-manual.zh_CN.po \
30 %D
%/guix-manual.zh_Hans.po
32 DOC_COOKBOOK_PO_FILES
= \
33 %D
%/guix-cookbook.de.po \
34 %D
%/guix-cookbook.fa.po \
35 %D
%/guix-cookbook.fr.po \
36 %D
%/guix-cookbook.ko.po
40 %D
%/guix-cookbook.pot \
42 $(DOC_COOKBOOK_PO_FILES
)
44 POT_OPTIONS
= --package-name
"guix manual" --package-version
"$(VERSION)" \
45 --copyright-holder
"the authors of Guix (msgids)" \
46 --msgid-bugs-address
"bug-guix@gnu.org"
49 @lang
=`echo "$@" | sed -e's/^doc-po-update-//'` ; \
50 output
="$(srcdir)/po/doc/guix-manual.$$lang.po" ; \
51 input
="$(srcdir)/po/doc/guix-manual.pot" ; \
52 if
test -f
"$$output"; then \
53 test "$(srcdir)" = .
&& cdcmd
="" || cdcmd
="cd $(srcdir) && "; \
54 echo
"$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $$output $$input"; \
56 && { case
`$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
57 '' |
0.
[0-9] |
0.
[0-9].
* |
0.1[0-7] |
0.1[0-7].
*) \
58 $(MSGMERGE_UPDATE
) $(MSGMERGE_OPTIONS
) "$$output" "$$input";; \
60 $(MSGMERGE_UPDATE
) $(MSGMERGE_OPTIONS
) --lang
=$${lang} "$$output" "$$input";; \
65 echo
"File $$output does not exist. If you are a translator, you can create it with 'msginit'." 1>&2; \
69 doc-po-update-cookbook-
%:
70 @lang
=`echo "$@" | sed -e's/^doc-po-update-cookbook-//'` ; \
71 output
="$(srcdir)/po/doc/guix-cookbook.$$lang.po" ; \
72 input
="$(srcdir)/po/doc/guix-cookbook.pot" ; \
73 if
test -f
"$$output"; then \
74 test "$(srcdir)" = .
&& cdcmd
="" || cdcmd
="cd $(srcdir) && "; \
75 echo
"$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $$output $$input"; \
77 && { case
`$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
78 '' |
0.
[0-9] |
0.
[0-9].
* |
0.1[0-7] |
0.1[0-7].
*) \
79 $(MSGMERGE_UPDATE
) $(MSGMERGE_OPTIONS
) "$$output" "$$input";; \
81 $(MSGMERGE_UPDATE
) $(MSGMERGE_OPTIONS
) --lang
=$${lang} "$$output" "$$input";; \
86 echo
"File $$output does not exist. If you are a translator, you can create it with 'msginit'." 1>&2; \
90 $(srcdir)/po
/doc
/%.pot-update
: doc
/%.texi
91 $(AM_V_PO4A
)$(PO4A_UPDATEPO
) -M UTF-8
-f texinfo
-m
"$<" \
92 -p
"$$(echo $@ | sed 's|-update||')" $(POT_OPTIONS
)
93 @touch
"$$(echo $@ | sed 's|-update||')"
95 TMP_POT_FILES
= contributing.pot guix.pot
98 for f in
$(TMP_POT_FILES
); do \
99 $(MAKE
) $(srcdir)/po
/doc
/guix.pot-update
; \
100 $(MAKE
) $(srcdir)/po
/doc
/contributing.pot-update
; \
102 $(MAKE
) $(srcdir)/po
/doc
/guix-cookbook.pot-update
;
103 msgcat
$(addprefix $(srcdir)/po
/doc
/, $(TMP_POT_FILES
)) > $(srcdir)/po
/doc
/guix-manual.pot
104 rm -f
$(addprefix $(srcdir)/po
/doc
/, $(TMP_POT_FILES
))
106 doc-po-update
: doc-pot-update
107 for f in
$(DOC_PO_FILES
); do \
108 lang
="`echo "$$f" | $(SED) -es'|.*/guix-manual\.\(.*\)\.po$$|\1|g'`"; \
109 $(MAKE
) "doc-po-update-$$lang"; \
111 for f in
$(DOC_COOKBOOK_PO_FILES
); do \
112 lang
="`echo "$$f" | $(SED) -es'|.*/guix-cookbook\.\(.*\)\.po$$|\1|g'`"; \
113 $(MAKE
) "doc-po-update-cookbook-$$lang"; \
117 .PHONY
: doc-po-update doc-pot-update