summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLex Neva <lexelby@users.noreply.github.com>2018-02-04 22:38:24 -0500
committerGitHub <noreply@github.com>2018-02-04 22:38:24 -0500
commit72d52dc317b562f728b772f058ab2c5059a2a618 (patch)
tree8c975a567e99d89514b6b49430b5b439d800f3e4 /Makefile
parent1dd76646cc5379e686a1c8785a4dc38b6e24c931 (diff)
framework for translations (#55)
sets up all the plumbing to send strings to CrowdIn for translation and incorporate the results
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 21 insertions, 1 deletions
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