From 33ce76c9af613e48e8f39dbc6d349e845bafb29d Mon Sep 17 00:00:00 2001 From: "Paul W. Frields" Date: Thu, 18 Oct 2012 19:47:45 -0400 Subject: Additional L10n rules --- Makefile | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index ebcd76e..1fe570d 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,8 @@ # Licensed uner the GNU General Public License, v2 or later. # +##################### +# Vars ifndef LANGUAGES LANGUAGES:=$(shell ls po/*.po | sed 's/po\/\(.*\).po/\1/') endif @@ -17,26 +19,30 @@ GIT=$(shell which git) LATEST_TAG=$(shell git describe --tags --abbrev=0) LATEST_VERSION=$(shell $(PYTHON) -c 'from pulsecaster.config import VERSION; print "%s" % (VERSION)') +##################### +# Initial stuff +.PHONY:: all clean vars all:: -.PHONY:: vars vars:: @echo LATEST_TAG = $(LATEST_TAG) @echo LATEST_VERSION = $(LATEST_VERSION) - ##################### -.PHONY:: all clean ##################### # L10n support +.PHONY:: tx-pull +tx-pull:: + $(TX) pull -a + .PHONY:: po -all:: po -po: $(foreach L,$(LANGUAGES),po/$(L).po) +po: tx-pull $(foreach L,$(LANGUAGES),po/$(L).po) define PO_template = PO_FILES+= po/$(1).po po/$(1).po: po/$(DOMAIN).pot + $(TX) pull -a -l $(1) $(PYTHON) setup.py update_catalog -l $(1) -i po/$(DOMAIN).pot -o po/$(1).po -D $(DOMAIN) >/dev/null endef $(foreach L,$(LANGUAGES),$(eval $(call PO_template,$(L)))) @@ -57,12 +63,21 @@ endef $(foreach L,$(LANGUAGES),$(eval $(call MO_template,$(L)))) vars:: @echo MO_FILES = $(MO_FILES) + +.PHONY:: stats +define STATS_template = +stats:: stats-$(1) +stats-$(1): po/$(1).po + @echo -n "$(1): " && msgfmt --statistics po/$(1).po +endef +$(foreach L,$(LANGUAGES),$(eval $(call STATS_template,$(L)))) ##################### ##################### # Release stuff +.PHONY:: release release:: $(DOMAIN)-$(LATEST_VERSION).tar.gz -$(DOMAIN)-$(LATEST_VERSION).tar.gz:: +$(DOMAIN)-$(LATEST_VERSION).tar.gz:: po ifneq ($(LATEST_TAG),$(LATEST_VERSION)) @echo Version=$(LATEST_VERSION), latest git tag=$(LATEST_TAG), either fix config.py or tag repo else -- cgit