diff options
| author | Ricardo Wurmus <rekado@elephly.net> | 2019-09-08 14:35:44 +0200 |
|---|---|---|
| committer | Ricardo Wurmus <rekado@elephly.net> | 2019-09-18 11:38:14 +0200 |
| commit | 7bc46ecc34ceb042ff890e5d306d0a2a736e891d (patch) | |
| tree | 9f5952d815edc41bae127e101ee1781ed1eb809a /po/doc/local.mk | |
| parent | a870b80046d532329762095683d8f9c33538eaf1 (diff) | |
doc: Add Guix Cookbook.
* .gitignore: Update ignore list.
* Makefile.am (assert-no-store-file-names): Exclude the cookbook.
* bootstrap: Generate po files for cookbook translations.
* doc/guix-cookbook.texi: New file.
* doc/local.mk (info_TEXINFOS): Add it; add a rule to build cookbook
translations.
* po/doc/local.mk (DOC_COOKBOOK_PO_FILES): New variable.
(EXTRA_DIST): Add cookbook pot file and po files.
(doc-po-update-cookbook-%): New target.
(doc-pot-update): Also update cookbook pot file.
(doc-po-update): Also update cookbook po files.
Diffstat (limited to 'po/doc/local.mk')
| -rw-r--r-- | po/doc/local.mk | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/po/doc/local.mk b/po/doc/local.mk index fb3c5aee03c..f1a52615c18 100644 --- a/po/doc/local.mk +++ b/po/doc/local.mk | |||
| @@ -23,9 +23,13 @@ DOC_PO_FILES= \ | |||
| 23 | %D%/guix-manual.ru.po \ | 23 | %D%/guix-manual.ru.po \ |
| 24 | %D%/guix-manual.zh_CN.po | 24 | %D%/guix-manual.zh_CN.po |
| 25 | 25 | ||
| 26 | DOC_COOKBOOK_PO_FILES= | ||
| 27 | |||
| 26 | EXTRA_DIST = \ | 28 | EXTRA_DIST = \ |
| 27 | %D%/guix-manual.pot \ | 29 | %D%/guix-manual.pot \ |
| 28 | $(DOC_PO_FILES) | 30 | %D%/guix-cookbook.pot \ |
| 31 | $(DOC_PO_FILES) \ | ||
| 32 | $(DOC_COOKBOOK_PO_FILES) | ||
| 29 | 33 | ||
| 30 | POT_OPTIONS = --package-name "guix" --package-version "$(VERSION)" \ | 34 | POT_OPTIONS = --package-name "guix" --package-version "$(VERSION)" \ |
| 31 | --copyright-holder "Ludovic Courtès" \ | 35 | --copyright-holder "Ludovic Courtès" \ |
| @@ -52,6 +56,27 @@ doc-po-update-%: | |||
| 52 | exit 1; \ | 56 | exit 1; \ |
| 53 | fi | 57 | fi |
| 54 | 58 | ||
| 59 | doc-po-update-cookbook-%: | ||
| 60 | @lang=`echo "$@" | sed -e's/^doc-po-update-//'` ; \ | ||
| 61 | output="$(srcdir)/po/doc/guix-cookbook.$$lang.po" ; \ | ||
| 62 | input="$(srcdir)/po/doc/guix-cookbook.pot" ; \ | ||
| 63 | if test -f "$$output"; then \ | ||
| 64 | test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ | ||
| 65 | echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $$output $$input"; \ | ||
| 66 | cd $(srcdir) \ | ||
| 67 | && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ | ||
| 68 | '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ | ||
| 69 | $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) "$$output" "$$input";; \ | ||
| 70 | *) \ | ||
| 71 | $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} "$$output" "$$input";; \ | ||
| 72 | esac; \ | ||
| 73 | }; \ | ||
| 74 | touch "$$output"; \ | ||
| 75 | else \ | ||
| 76 | echo "File $$output does not exist. If you are a translator, you can create it with 'msginit'." 1>&2; \ | ||
| 77 | exit 1; \ | ||
| 78 | fi | ||
| 79 | |||
| 55 | $(srcdir)/po/doc/%.pot-update: doc/%.texi | 80 | $(srcdir)/po/doc/%.pot-update: doc/%.texi |
| 56 | $(AM_V_PO4A)$(PO4A_UPDATEPO) -M UTF-8 -f texinfo -m "$<" \ | 81 | $(AM_V_PO4A)$(PO4A_UPDATEPO) -M UTF-8 -f texinfo -m "$<" \ |
| 57 | -p "$$(echo $@ | sed 's|-update||')" $(POT_OPTIONS) | 82 | -p "$$(echo $@ | sed 's|-update||')" $(POT_OPTIONS) |
| @@ -64,6 +89,7 @@ doc-pot-update: | |||
| 64 | $(MAKE) $(srcdir)/po/doc/guix.pot-update; \ | 89 | $(MAKE) $(srcdir)/po/doc/guix.pot-update; \ |
| 65 | $(MAKE) $(srcdir)/po/doc/contributing.pot-update; \ | 90 | $(MAKE) $(srcdir)/po/doc/contributing.pot-update; \ |
| 66 | done | 91 | done |
| 92 | $(MAKE) $(srcdir)/po/doc/guix-cookbook.pot-update; | ||
| 67 | msgcat $(addprefix $(srcdir)/po/doc/, $(TMP_POT_FILES)) > $(srcdir)/po/doc/guix-manual.pot | 93 | msgcat $(addprefix $(srcdir)/po/doc/, $(TMP_POT_FILES)) > $(srcdir)/po/doc/guix-manual.pot |
| 68 | rm -f $(addprefix $(srcdir)/po/doc/, $(TMP_POT_FILES)) | 94 | rm -f $(addprefix $(srcdir)/po/doc/, $(TMP_POT_FILES)) |
| 69 | 95 | ||
| @@ -72,5 +98,10 @@ doc-po-update: doc-pot-update | |||
| 72 | lang="`echo "$$f" | $(SED) -es'|.*/guix-manual\.\(.*\)\.po$$|\1|g'`"; \ | 98 | lang="`echo "$$f" | $(SED) -es'|.*/guix-manual\.\(.*\)\.po$$|\1|g'`"; \ |
| 73 | $(MAKE) "doc-po-update-$$lang"; \ | 99 | $(MAKE) "doc-po-update-$$lang"; \ |
| 74 | done | 100 | done |
| 101 | for f in $(DOC_COOKBOOK_PO_FILES); do \ | ||
| 102 | lang="`echo "$$f" | $(SED) -es'|.*/guix-cookbook\.\(.*\)\.po$$|\1|g'`"; \ | ||
| 103 | $(MAKE) "doc-po-update-cookbook-$$lang"; \ | ||
| 104 | done | ||
| 105 | |||
| 75 | 106 | ||
| 76 | .PHONY: doc-po-update doc-pot-update | 107 | .PHONY: doc-po-update doc-pot-update |
