Add .gitignore file for git.
[virt-p2v.git] / po / Makefile.in
index 46f1a13..e309170 100644 (file)
@@ -34,7 +34,13 @@ POFILES              = $(addsuffix .po,$(LINGUAS))
 MOFILES                = $(addsuffix .mo,$(LINGUAS))
 POTFILE                = $(OCAML_GETTEXT_PACKAGE).pot
 
-all: $(MOFILES) $(POTFILE)
+all: ../.tmp.virt-p2v.ml $(MOFILES) $(POTFILE)
+
+# This is just a hack because ocaml-gettext doesn't know what to
+# do with a file that doesn't end in a *.ml extension, and even
+# if renamed it doesn't work because of the toplevel directives.
+../.tmp.virt-p2v.ml: ../virt-p2v
+       grep -v '^#' < $< > $@
 
 install: install-po
 
@@ -50,9 +56,12 @@ clean:: clean-po
        $(OCAML_GETTEXT) --action extract $(OCAML_GETTEXT_EXTRACT_OPTIONS) \
        --extract-pot $@ $<
 
+# Also includes a fix for incorrectly escaped multi-byte sequences.
 %.po: $(POTFILE)
        $(OCAML_GETTEXT) --action merge   $(OCAML_GETTEXT_MERGE_OPTIONS) \
        --merge-pot $(POTFILE) $@
+       mv $@ $@.orig
+       perl -wpe 's/\\(\d{3})/pack "C*", $$1/ge' < $@.orig > $@
 
 $(BUILDPO):
        mkdir -p $(BUILDPO)