nls: Add Chinese (Traditional) translation.
[jackhill/guix/guix.git] / po / doc / local.mk
1 # GNU Guix --- Functional package management for GNU
2 # Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
3 #
4 # This file is part of GNU Guix.
5 #
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.
10 #
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.
15 #
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/>.
18
19 DOC_PO_FILES= \
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
31
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
37
38 EXTRA_DIST = \
39 %D%/guix-manual.pot \
40 %D%/guix-cookbook.pot \
41 $(DOC_PO_FILES) \
42 $(DOC_COOKBOOK_PO_FILES)
43
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"
47
48 doc-po-update-%:
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"; \
55 cd $(srcdir) \
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";; \
59 *) \
60 $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} "$$output" "$$input";; \
61 esac; \
62 }; \
63 touch "$$output"; \
64 else \
65 echo "File $$output does not exist. If you are a translator, you can create it with 'msginit'." 1>&2; \
66 exit 1; \
67 fi
68
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"; \
76 cd $(srcdir) \
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";; \
80 *) \
81 $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} "$$output" "$$input";; \
82 esac; \
83 }; \
84 touch "$$output"; \
85 else \
86 echo "File $$output does not exist. If you are a translator, you can create it with 'msginit'." 1>&2; \
87 exit 1; \
88 fi
89
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||')"
94
95 TMP_POT_FILES = contributing.pot guix.pot
96
97 doc-pot-update:
98 for f in $(TMP_POT_FILES); do \
99 $(MAKE) $(srcdir)/po/doc/guix.pot-update; \
100 $(MAKE) $(srcdir)/po/doc/contributing.pot-update; \
101 done
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))
105
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"; \
110 done
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"; \
114 done
115
116
117 .PHONY: doc-po-update doc-pot-update