diff options
-rw-r--r-- | Makefile | 23 |
1 files changed, 18 insertions, 5 deletions
@@ -86,12 +86,14 @@ $(foreach source,$(SOURCES),$(foreach module,$($(source)_POMODULES),$(eval $(cal # 1:moduledir 2:locale 3:mastermodule 4:source -define PO_template +define INITPO_template fileformat = $(if $(filter templates,$(3)),htmltemplate,text) filetype = $(if $(filter templates,$(3)),tmpl,mdwn) ALL_POFILES += $(podir)/$(3).$(2).po -ifeq ($(translation_mode),init) +$(4)_POMODULES := $(filter-out $(3),$$($(4)_POMODULES)) +$(4)_POLOCALES := $(filter-out $(2),$$($(4)_POLOCALES)) + $(podir)/$(3).$(2).po: $(1) $(3) ( cd "$(3)" && po4a-gettextize -M UTF-8 -L UTF-8 -f $$(fileformat) $$(patsubst %,-m %,$$($(3)_L10NFILES)) $$(patsubst %,-l $$(CURDIR)/$(1)/%,$($(3)_L10NFILES)) ) \ | grep -v '#, fuzzy' \ @@ -101,18 +103,29 @@ $(podir)/$(3).$(2).po: $(1) $(3) $$(patsubst %,$(1)/%,$$($(3)_L10NFILES)): $(podir)/$(3).$(2).po mkdir -p $(1) cd "$(1)" && po4a-translate -M UTF-8 -L UTF-8 -k 0 -f $(fileformat) $$(patsubst $(1)/%,-m $(CURDIR)/$(3)/%,$$@) -p $(CURDIR)/$(podir)/$(3).$(locale).po -l $(CURDIR)/$$@ -else + +.PHONY: $(1) +endef +$(foreach source,$(SOURCES),$(foreach module,$(po-init-modules),$(foreach locale,$(po-init-locales),$(eval $(call INITPO_template,$(l10ndir),$(locale),$(module),$(source)))))) + + + +# 1:moduledir 2:locale 3:mastermodule 4:source +define PO_template +fileformat = $(if $(filter templates,$(3)),htmltemplate,text) +filetype = $(if $(filter templates,$(3)),tmpl,mdwn) +ALL_POFILES += $(podir)/$(3).$(2).po + $(podir)/$(3).$(2).po: $(3) cd "$(3)" && po4a-updatepo -M UTF-8 -f $(fileformat) $(patsubst %,-m %,$$($(3)_L10NFILES)) -p $(CURDIR)/$$@ $$(patsubst %,$(1)/%,$$($(3)_L10NFILES)): $(podir)/$(3).$(2).po mkdir -p $(1) cd "$(1)" && po4a-translate -M UTF-8 -L UTF-8 -k 100 -f $(fileformat) $$(patsubst $(1)/%,-m $(CURDIR)/$(3)/%,$$@) -p $(CURDIR)/$(podir)/$(3).$(locale).po -l $(CURDIR)/$$@ -endif .PHONY: $(1) endef -$(foreach source,$(SOURCES),$(foreach module,$($(source)_POMODULES),$(foreach locale,$($(source)_LOCALES),$(eval $(call PO_template,$(l10ndir),$(locale),$(module),$(source)))))) +$(foreach source,$(SOURCES),$(foreach module,$($(source)_POMODULES),$(foreach locale,$($(source)_POLOCALES),$(eval $(call PO_template,$(l10ndir),$(locale),$(module),$(source)))))) |