From 814d907e2eaf50bcaa8927814fffa05f09913db9 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 4 Nov 2007 17:58:10 +0100 Subject: Add make rule to generate pot files. --- Makefile | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3