Update POs and POT.
[enc.git] / Makefile
index 4e353403b3408dae706b8f12fb3ae0122353da1b..0ba23ed3bad6a41a7291dc98282bb75e51e2e396 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,8 @@
+# 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\
@@ -76,5 +85,17 @@ esd-%.po.extract: $(foreach d,$(DIR) %,$(foreach f,$(FILES),$d/$f))
 # 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).