summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile17
1 files changed, 16 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 3119588..d4c574a 100644
--- a/Makefile
+++ b/Makefile
@@ -10,6 +10,11 @@ locales_ikiwiki = da
underlays_l10n = $(foreach source, $(sources), $(foreach locale, $(locales_$(source)), $(patsubst %,%_l10n/$(locale),$(underlays_$(source)))))
underlays = $(foreach source, $(sources), $(underlays_$(source))) $(underlays_l10n)
+# FIXME: Handle translation of templates (needs po4a parser for HTML::Template markup)
+#potfiles = $(foreach source, $(sources), $(patsubst %,po/%.pot,$(underlays_$(source))))
+potfiles = $(filter-out templates,$(foreach source, $(sources), $(patsubst %,po/%.pot,$(underlays_$(source)))))
+pofiles = $(foreach locale, $(locales_$(source)), $(patsubst %.pot/%.$(locale).po,$(locale)))
+
source_of_underlay = $(firstword $(foreach source, $(sources), $(if $(filter $(underlay),$(underlays_$(source))),$(source))))
origin = $(origin_$(source_of_underlay))
master = $(master_$(source_of_underlay))
@@ -31,6 +36,15 @@ $(underlays):
git config remote.origin.push +refs/heads/master:refs/heads/$(master); \
fi
+pot: $(potfiles)
+
+# FIXME: The po4a plugin for HTML::Template needs to be written...
+$(potfiles): underlay=$(patsubst po/%.pot,%,$@)
+$(potfiles): fileformat=$(if $(filter templates,$(underlay)),htmltemplate,text)
+$(potfiles): filetype=$(if $(filter templates,$(underlay)),tmpl,mdwn)
+$(potfiles):
+ cd $(underlay) && po4a-gettextize -M UTF-8 -L UTF-8 -f $(fileformat) $(patsubst %,-m %,$(shell cd "$(underlay)" && find * -type f -name '*.$(filetype)')) -p $(CURDIR)/$@
+
$(dummies):
mkdir -p $@
@@ -44,4 +58,5 @@ ultraclean:
rm -rf $(dir $(underlays_l10n))
rm -rf $(dummies)
-.PHONY: $(underlays)
+
+.PHONY: pot po translations $(underlays)