forked from CZ-NIC/djangocms-aldryn-forms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (39 loc) · 1.44 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
APP = aldryn_forms
CODES ?= cs de en fa fr it lt nl
.PHONY: help msg-make msg-compile test check-js build-js-css
help:
@echo "make msg-make"
@echo " Make translations."
@echo "make msg-compile"
@echo " Compile translations. Use CODES in the same way as for the msg-make."
@echo "make test"
@echo " Run tests."
@echo "make check-js:"
@echo " Check javascript code. Run npm -i manually before the command."
@echo "make build-js-css"
@echo " Build js and css. Run npm -i manually if node_modules isn't installed yet."
# Translations
msg-make:
@unset -v DJANGO_SETTINGS_MODULE;
@cd ${APP} && for CODE in ${CODES}; \
do \
django-admin makemessages -l $$CODE; \
django-admin makemessages -l $$CODE -d djangojs; \
msgattrib --sort-output --no-location --no-obsolete --no-fuzzy --output-file=locale/$$CODE/LC_MESSAGES/django.po locale/$$CODE/LC_MESSAGES/django.po; \
msgattrib --sort-output --no-location --no-obsolete --no-fuzzy --output-file=locale/$$CODE/LC_MESSAGES/djangojs.po locale/$$CODE/LC_MESSAGES/djangojs.po; \
done
msg-compile:
@cd ${APP}/locale && for CODE in ${CODES}; \
do \
echo "compile locale $$CODE"; \
msgfmt $$CODE/LC_MESSAGES/django.po -o $$CODE/LC_MESSAGES/django.mo; \
if [ -r $$CODE/LC_MESSAGES/djangojs.po ]; then \
msgfmt $$CODE/LC_MESSAGES/djangojs.po -o $$CODE/LC_MESSAGES/djangojs.mo; \
fi; \
done
test:
tox --parallel all --parallel-live
check-js:
npm run check-js
build-js-css:
npm run build