You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

109 lines
4.0 KiB

  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. DOC_PO_FILES= \
  19. %D%/guix-manual.es.po \
  20. %D%/guix-manual.de.po \
  21. %D%/guix-manual.fr.po \
  22. %D%/guix-manual.ru.po \
  23. %D%/guix-manual.zh_CN.po
  24. DOC_COOKBOOK_PO_FILES= \
  25. %D%/guix-cookbook.de.po
  26. EXTRA_DIST = \
  27. %D%/guix-manual.pot \
  28. %D%/guix-cookbook.pot \
  29. $(DOC_PO_FILES) \
  30. $(DOC_COOKBOOK_PO_FILES)
  31. POT_OPTIONS = --package-name "guix" --package-version "$(VERSION)" \
  32. --copyright-holder "Ludovic Courtès" \
  33. --msgid-bugs-address "ludo@gnu.org"
  34. doc-po-update-%:
  35. @lang=`echo "$@" | sed -e's/^doc-po-update-//'` ; \
  36. output="$(srcdir)/po/doc/guix-manual.$$lang.po" ; \
  37. input="$(srcdir)/po/doc/guix-manual.pot" ; \
  38. if test -f "$$output"; then \
  39. test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
  40. echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $$output $$input"; \
  41. cd $(srcdir) \
  42. && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
  43. '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
  44. $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) "$$output" "$$input";; \
  45. *) \
  46. $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} "$$output" "$$input";; \
  47. esac; \
  48. }; \
  49. touch "$$output"; \
  50. else \
  51. echo "File $$output does not exist. If you are a translator, you can create it with 'msginit'." 1>&2; \
  52. exit 1; \
  53. fi
  54. doc-po-update-cookbook-%:
  55. @lang=`echo "$@" | sed -e's/^doc-po-update-cookbook-//'` ; \
  56. output="$(srcdir)/po/doc/guix-cookbook.$$lang.po" ; \
  57. input="$(srcdir)/po/doc/guix-cookbook.pot" ; \
  58. if test -f "$$output"; then \
  59. test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
  60. echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $$output $$input"; \
  61. cd $(srcdir) \
  62. && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
  63. '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
  64. $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) "$$output" "$$input";; \
  65. *) \
  66. $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} "$$output" "$$input";; \
  67. esac; \
  68. }; \
  69. touch "$$output"; \
  70. else \
  71. echo "File $$output does not exist. If you are a translator, you can create it with 'msginit'." 1>&2; \
  72. exit 1; \
  73. fi
  74. $(srcdir)/po/doc/%.pot-update: doc/%.texi
  75. $(AM_V_PO4A)$(PO4A_UPDATEPO) -M UTF-8 -f texinfo -m "$<" \
  76. -p "$$(echo $@ | sed 's|-update||')" $(POT_OPTIONS)
  77. @touch "$$(echo $@ | sed 's|-update||')"
  78. TMP_POT_FILES = contributing.pot guix.pot
  79. doc-pot-update:
  80. for f in $(TMP_POT_FILES); do \
  81. $(MAKE) $(srcdir)/po/doc/guix.pot-update; \
  82. $(MAKE) $(srcdir)/po/doc/contributing.pot-update; \
  83. done
  84. $(MAKE) $(srcdir)/po/doc/guix-cookbook.pot-update;
  85. msgcat $(addprefix $(srcdir)/po/doc/, $(TMP_POT_FILES)) > $(srcdir)/po/doc/guix-manual.pot
  86. rm -f $(addprefix $(srcdir)/po/doc/, $(TMP_POT_FILES))
  87. doc-po-update: doc-pot-update
  88. for f in $(DOC_PO_FILES); do \
  89. lang="`echo "$$f" | $(SED) -es'|.*/guix-manual\.\(.*\)\.po$$|\1|g'`"; \
  90. $(MAKE) "doc-po-update-$$lang"; \
  91. done
  92. for f in $(DOC_COOKBOOK_PO_FILES); do \
  93. lang="`echo "$$f" | $(SED) -es'|.*/guix-cookbook\.\(.*\)\.po$$|\1|g'`"; \
  94. $(MAKE) "doc-po-update-cookbook-$$lang"; \
  95. done
  96. .PHONY: doc-po-update doc-pot-update