-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathdocker.mk
More file actions
51 lines (37 loc) · 1.49 KB
/
Copy pathdocker.mk
File metadata and controls
51 lines (37 loc) · 1.49 KB
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
47
48
49
50
51
LESS_FILES = $(shell find thinkhazard/static/less -type f -name '*.less' 2> /dev/null)
JS_FILES = $(shell find thinkhazard/static/js -type f -name '*.js' 2> /dev/null)
PY_FILES = $(shell find thinkhazard -type f -name '*.py' 2> /dev/null)
-include local.mk
#########################
# Internal build target #
#########################
.PHONY: build
build: compile_catalog
.PHONY: compile_catalog
compile_catalog: \
/opt/thinkhazard/thinkhazard/locale/fr/LC_MESSAGES/thinkhazard.mo \
/opt/thinkhazard/thinkhazard/locale/es/LC_MESSAGES/thinkhazard.mo
/opt/thinkhazard/thinkhazard/locale/%/LC_MESSAGES/thinkhazard.mo: thinkhazard/locale/%/LC_MESSAGES/thinkhazard.po
mkdir -p $(dir $@)
msgfmt -o $@ $<
TX_BRANCH_DASHED := $(subst .,-,$(TX_BRANCH))
ifdef TX_TOKEN
thinkhazard/locale/%/LC_MESSAGES/thinkhazard.po: $(HOME)/.transifexrc
tx pull --translations --languages=$* --resources=gfdrr-thinkhazard.$(TX_BRANCH_DASHED)-ui --force
touch `find thinkhazard/locale/ -name '*.po' 2> /dev/null`
.INTERMEDIATE: $(HOME)/.transifexrc
$(HOME)/.transifexrc:
echo "[https://www.transifex.com]" > $@
echo "rest_hostname = https://rest.api.transifex.com" >> $@
@echo "token = $(TX_TOKEN)" >> $@
cat $@
else
thinkhazard/locale/%/LC_MESSAGES/thinkhazard.po:
@echo "WARNING: TX_TOKEN not set, skipping Transifex pull. Using empty translations for $*."
mkdir -p $(dir $@)
@printf 'msgid ""\nmsgstr ""\n"Content-Type: text/plain; charset=UTF-8\\n"\n' > $@
endif
check: flake8
.PHONY: flake8
flake8:
flake8 $(PY_FILES)