+# This source code is released in public domain.
+
+# Author Tomas Stary (2016) <tomichec@gmail.com>
+# Thanks for helpfull discussion to Thérèse Godefroy
+
# This is a Makefile to generate the PO files for automated
# translation. If you get through the trouble of creating PO file for
# your language, you will save a lot of hassles with editing plain html
# files using: make -f Makefile.gen
# flags for the po4a-getextize
-PO4A_FLAGS=-M utf-8 -f xhtml
+PO4A_FLAGS=-M utf-8 -f xhtml -o porefs=none \
+ -o 'untranslated=<script>' \
+ -o 'attributes=<meta>content' \
+ --package-name emailselfdefense --package-version $version
+
# list of source files for the translation
SRC=confirmation.html\
index.html\
# that changed need to be translated again.
esd-%.po.update: esd-%.po $(foreach f,$(SRC),en/$f)
cp $< $@
- po4a-updatepo $(PO4A_FLAGS) $(foreach f,$(SRC),-m en/$f) -p $@
- cp $@ $<
+ po4a-updatepo $(PO4A_FLAGS) $(foreach f,$(SRC),-m en/$f) -p $@; \
+./gnun-add-fuzzy-diff $@ > $<
+
+# TODO: The system could be further refined with 2 external scripts:
+
+# - gnun-add-fuzzy-diff (from the GNUN package [4]). Very useful to locate
+# a change within a string. It runs after po4a-updatepo.
+
+# - some sort of reformatting script to get rid of the extra spaces, tabs,
+# linefeeds, etc., to make sure that a spurious difference between
+# index.html, mac.html and windows.html isn't going to add useless strings
+# to an existing POT file, or make the POs fuzzy for no reason. There is
+# such a script in the kitchen (reformat-html), but I am currently using a
+# simpler one (reformat-original, attached).