inkstitch/Makefile

54 wiersze
1.7 KiB
Makefile
Czysty Zwykły widok Historia

2019-04-12 16:02:26 +00:00
dist: locales inx
bin/build-python
2019-04-11 03:38:43 +00:00
bin/build-electron
bin/build-distribution-archives
distclean:
2019-04-12 16:02:26 +00:00
rm -rf build dist inx locales *.spec *.tar.gz *.zip electron/node_modules electron/dist
.PHONY: inx
2018-08-21 00:42:02 +00:00
inx: locales
mkdir -p inx
2019-11-15 18:09:53 +00:00
python bin/generate-inx-files; \
.PHONY: messages.po
messages.po:
rm -f messages.po
bin/pyembroidery-gettext > pyembroidery-format-descriptions.py
bin/inkstitch-fonts-gettext > inkstitch-fonts-metadata.py
2020-04-28 16:34:05 +00:00
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
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
electron/src/renderer/assets/translations.json: $(addsuffix /LC_MESSAGES/inkstitch.po,$(wildcard locales/*))
find locales -name '*.po' -a ! -empty | \
xargs electron/node_modules/.bin/gettext-compile --output electron/src/renderer/assets/translations.json
%.po: %.mo
msgunfmt -o $@ $<
2018-09-15 17:01:41 +00:00
.PHONY: clean
clean:
rm -f messages.po pyembroidery-format-descriptions.py
.PHONY: locales
locales:
# message files will look like this:
2018-02-05 04:01:59 +00:00
# translations/messages_en_US.po
if ls translations/*.po > /dev/null 2>&1; then \
for po in translations/*.po; do \
2018-02-05 04:01:59 +00:00
lang=$${po%.*}; \
lang=$${lang#*_}; \
mkdir -p locales/$$lang/LC_MESSAGES/; \
msgfmt $$po -o locales/$$lang/LC_MESSAGES/inkstitch.mo; \
done; \
else \
2018-02-05 04:01:59 +00:00
mkdir -p locales; \
fi
2018-08-22 18:54:14 +00:00
.PHONY: style
style:
2019-04-12 19:32:37 +00:00
flake8 . --count --max-complexity=10 --max-line-length=150 --statistics --exclude=pyembroidery,__init__.py,electron,build