view po/Makefile @ 536:a59622c06936

Fix generating reports if no week given unix_week() cannot handle week being None but does so for year. It just assumes the current year in this case, although this only duplicates the initialisation of year with c_year in this context. week being None gives TypeError: unsupported operand type(s) for -: 'NoneType' and 'int' load_entries() handles the case with no week given, thus call it anyhow. This fix makes it possible to invoke scripts/getan-report with a year given but no week and seeing the expected result (data for a whole year) instead of a traceback.
author Tom Gottfried <tom@intevation.de>
date Thu, 09 Jan 2020 11:32:34 +0100
parents e6f81aa329b1
children
line wrap: on
line source
all:
	@echo 'Usage:'
	@echo '   make pot     create getan.pot'
	@echo '   make merge   merge a new getan.pot with the *.po files'
	@echo '   make mo      create the mo files'
	@echo '   make stat    print statistics about the translation status'

MO_DIR = ../share/locale
DOMAIN = getan

pot:
	pygettext -o $(DOMAIN).pot ../getan/*.py

merge:
	for po in *.po; do \
		lingua=`basename $$po .po`; \
	        mv $$lingua.po $$lingua.old.po; \
		if msgmerge -o $$lingua.po $$lingua.old.po $(DOMAIN).pot; then\
		    rm $$lingua.old.po; \
		else \
		    rm -f $$lingua.po; \
		    mv $$lingua.old.po $$lingua.po; \
		fi \
	done


mo:
	for po in *.po; do\
		lingua=`basename $$po .po`; \
		install -d $(MO_DIR)/$$lingua/LC_MESSAGES/ ; \
		echo -n $$po": "; \
		msgfmt --statistics \
			-o $(MO_DIR)/$$lingua/LC_MESSAGES/$(DOMAIN).mo $$po ;\
	done


stat:
	@for po in *.po; do\
		echo -n $$po": "; \
		msgfmt --statistics -o /dev/null $$po 2>&1 \
		 | sed -e 's/ \(messages*\|translations*\)//g' -e 's/\.$$//' ; \
	done
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)