Skip to content

Commit

Permalink
Merge pull request #85 from Intevation/master
Browse files Browse the repository at this point in the history
Improve Makefile target `makemessages`
  • Loading branch information
vperron authored Feb 5, 2019
2 parents 84975ab + a30ef09 commit 1003467
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,14 @@ translations: ./$(OUTPUT_DIR)/translations.json
# Generate .po files for each available language.
@for lang in $(LOCALES); do \
export PO_FILE=$(OUTPUT_DIR)/locale/$$lang/LC_MESSAGES/app.po; \
echo "msgmerge --update $$PO_FILE $@"; \
mkdir -p $$(dirname $$PO_FILE); \
[ -f $$PO_FILE ] && msgmerge --lang=$$lang --update $$PO_FILE $@ || msginit --no-translator --locale=$$lang --input=$@ --output-file=$$PO_FILE; \
msgattrib --no-wrap --no-obsolete -o $$PO_FILE $$PO_FILE; \
if [ -f $$PO_FILE ]; then \
echo "msgmerge --update $$PO_FILE $@"; \
msgmerge --lang=$$lang --update $$PO_FILE $@ || break ;\
else \
msginit --no-translator --locale=$$lang --input=$@ --output-file=$$PO_FILE || break ; \
msgattrib --no-wrap --no-obsolete -o $$PO_FILE $$PO_FILE || break; \
fi; \
done;

$(OUTPUT_DIR)/translations.json: clean /tmp/template.pot
Expand Down

0 comments on commit 1003467

Please sign in to comment.