summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile28
1 files changed, 11 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index e7fcf2df..c81e2a98 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,10 @@
-
dist: version locales inx
bash bin/build-python
bash bin/build-electron
bash bin/build-distribution-archives
distclean:
- rm -rf build dist inx locales *.spec *.tar.gz *.zip electron/node_modules electron/dist
+ rm -rf build dist inx locales artifacts win mac *.spec *.tar.gz *.zip electron/node_modules electron/dist
.PHONY: inx
inx: version locales
@@ -13,15 +12,21 @@ inx: version locales
python bin/generate-inx-files; \
.PHONY: messages.po
-messages.po:
+messages.po: inx
rm -f messages.po
+ xgettext inx/*.inx --its=its/inx.its -o messages-inx.po
+ # There seems to be no proper way to set the charset to utf-8
+ sed -i 's/charset=CHARSET/charset=UTF-8/g' messages-inx.po
bin/pyembroidery-gettext > pyembroidery-format-descriptions.py
bin/inkstitch-fonts-gettext > inkstitch-fonts-metadata.py
+ # After the inx files are finished building, we don't need the src/ folder anymore.
+ # We don't want babel to grab possible translation strings from that folder, so let's remove it
+ rm -rf src/
pybabel extract -o messages-babel.po -F babel.conf --add-location=full --add-comments=l10n,L10n,L10N --sort-by-file --strip-comments -k N_ -k '$$gettext' .
rm pyembroidery-format-descriptions.py inkstitch-fonts-metadata.py
cd electron && yarn --link-duplicates --pure-lockfile
find electron/src -name '*.html' -o -name '*.js' -o -name '*.vue' | xargs electron/node_modules/.bin/gettext-extract --quiet --attribute v-translate --output messages-vue.po
- msgcat -o messages.po messages-babel.po messages-vue.po
+ msgcat -o messages.po messages-babel.po messages-vue.po messages-inx.po
electron/src/renderer/assets/translations.json: $(wildcard translations/messages_*.po)
find translations -name '*.po' -a ! -empty | \
@@ -36,18 +41,7 @@ clean:
.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%.*}; \
- lang=$${lang#*_}; \
- mkdir -p locales/$$lang/LC_MESSAGES/; \
- msgfmt $$po -o locales/$$lang/LC_MESSAGES/inkstitch.mo; \
- done; \
- else \
- mkdir -p locales; \
- fi
+ bash bin/generate-translation-files
.PHONY: version
version:
@@ -55,4 +49,4 @@ version:
.PHONY: style
style:
- flake8 . --count --max-complexity=10 --max-line-length=150 --statistics --exclude=pyembroidery,__init__.py,electron,build,src
+ bash -x bin/style-check