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.
 
 
 
 
 
 

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