From 72d52dc317b562f728b772f058ab2c5059a2a618 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sun, 4 Feb 2018 22:38:24 -0500 Subject: framework for translations (#55) sets up all the plumbing to send strings to CrowdIn for translation and incorporate the results --- Makefile | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index e45fabb8..f8c4d35f 100644 --- a/Makefile +++ b/Makefile @@ -5,10 +5,30 @@ VERSION:=$(TRAVIS_BRANCH) OS:=$(shell uname) ARCH:=$(shell uname -m) -dist: distclean +dist: distclean locales bin/build-dist $(EXTENSIONS) cp *.inx dist + mv locales dist/bin cd dist; tar zcf ../inkstitch-$(VERSION)-$(OS)-$(ARCH).tar.gz * distclean: rm -rf build dist *.spec *.tar.gz + +messages.po: embroider*.py inkstitch.py + rm -f messages.po + xgettext embroider*.py inkstitch.py + +.PHONY: locales +locales: + # message files will look like this: + # translations/messages-en_US.po + if ls translations/*.po > /dev/null 2>&1; then \ + for po in translations/*.po; do \ + lang=$${po%.po}; \ + lang=$${lang#messages-}; \ + mkdir -p locales/$$lang/LC_MESSAGES/; \ + msgfmt $$po -o locales/$$lang/LC_MESSAGES/inkstitch.mo; \ + done; \ + else \ + mkdir locales; \ + fi -- cgit v1.3.1