1 Author: Ben Hutchings <ben@decadent.org.uk>
2 Description: Support translated docs using po4a
3 Bug-Debian: https://bugs.debian.org/483665
7 @@ -13,5 +13,37 @@ chm: puzzles.hhp
8 puzzles.hhp: puzzles.but chm.but
9 halibut --html puzzles.but chm.but
11 +TRANSLATIONS := $(patsubst po/%.po,%,$(wildcard po/*.po))
14 +# Please tell me there is an easier way to preserve the POT file header.
15 + test -f po/puzzles-doc.pot
16 + po4a-gettextize -f halibut -m puzzles.but --package-name puzzles \
17 + -p po/puzzles-doc.tmp1.pot
18 + sed -i '1,/^#$$/d' po/puzzles-doc.tmp1.pot
19 + cat po/puzzles-doc.pot.head po/puzzles-doc.tmp1.pot \
20 + > po/puzzles-doc.tmp2.pot
21 + diff -q -I Project-Id-Version: -I POT-Creation-Date: \
22 + po/puzzles-doc.pot po/puzzles-doc.tmp2.pot || \
23 + mv po/puzzles-doc.tmp2.pot po/puzzles-doc.pot
24 + rm -f po/puzzles-doc.tmp*.pot
25 + for lang in $(TRANSLATIONS); do \
26 + msgmerge --previous -U po/$$lang.po po/puzzles-doc.pot || exit; \
30 +doc/puzzles.but.%: puzzles.but po/%.po
32 + po4a-translate -k 0 -f halibut -m puzzles.but -p po/$*.po -l $@
33 +.PRECIOUS: $(addprefix doc/puzzles.but.,$(TRANSLATIONS))
35 +doc/preprocessed.but.%: doc/puzzles.but.%
36 + sed 's/PREFIX-/$(BINPREFIX)/g' $< > $@
38 +doc/puzzles.txt.%: doc/preprocessed.but.%
39 + halibut --text=$@ --input-charset=UTF-8 $<
40 +all: $(addprefix doc/puzzles.txt.,$(TRANSLATIONS))
43 rm -f puzzles.hlp puzzles.txt preprocessed.but HACKING *.html *.hh[pck]