diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 35 |
1 files changed, 3 insertions, 32 deletions
@@ -2,40 +2,11 @@ | |||
2 | 2 | ||
3 | include build-system/config.mk | 3 | include build-system/config.mk |
4 | 4 | ||
5 | # List of all supported languages, add new languages here! | ||
6 | LANGUAGES="ar de en es fr hi it ja ko pt zh_Hant" | ||
7 | |||
8 | # All: build HTML pages in all languages and compile the | 5 | # All: build HTML pages in all languages and compile the |
9 | .PHONY: all | 6 | .PHONY: all |
10 | all: locale template | 7 | all: |
11 | env BASEURL=$(opt_baseurl) ./inc/make_site.py | 8 | ./inc/update-messages |
12 | 9 | env "BASEURL=$(opt_baseurl)" ./inc/build-site | |
13 | # Extract translateable strings from jinja2 templates. | ||
14 | locale/messages.pot: template/*.j2 template/news/*.j2 common/*.j2 common/*.j2.inc | ||
15 | env PYTHONPATH=$$PWD/inc:$$PYTHONPATH $(pybabel) extract -F locale/babel.map -o locale/messages.pot . | ||
16 | |||
17 | # Update translation (.po) files with new strings. | ||
18 | .PHONY: locale-update | ||
19 | locale-update: locale/messages.pot | ||
20 | for lang in `echo $(LANGUAGES)`; do \ | ||
21 | $(msgmerge) -q -U -m --previous locale/$$lang/LC_MESSAGES/messages.po locale/messages.pot ; \ | ||
22 | done | ||
23 | if $(grep) -nA1 '#-#-#-#-#' locale/*/LC_MESSAGES/messages.po; then \ | ||
24 | $(echo) -e "\nERROR: Conflicts encountered in PO files.\n"; \ | ||
25 | exit 1; \ | ||
26 | fi | ||
27 | |||
28 | # Compile translation files for use. | ||
29 | .PHONY: locale-compile | ||
30 | locale-compile: | ||
31 | for lang in `echo $(LANGUAGES)`; do \ | ||
32 | echo compiling $$lang; \ | ||
33 | $(pybabel) -q compile -d locale -l $$lang --use-fuzzy ; \ | ||
34 | done | ||
35 | |||
36 | # Process everything related to gettext translations. | ||
37 | .PHONY: locale | ||
38 | locale: locale-update locale-compile | ||
39 | 10 | ||
40 | .PHONY: run | 11 | .PHONY: run |
41 | run: all | 12 | run: all |