summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2021-05-07 18:04:18 +0200
committerFlorian Dold <florian@dold.me>2021-05-07 18:04:18 +0200
commit66c705567234ea566d93fb0d59a5872eb12ac826 (patch)
tree9e99e03864b921019bb63e35a8daed0c3db9956e /Makefile
parent40f0632030361574130fa6b2794d7fccaca4eacb (diff)
downloadwww-66c705567234ea566d93fb0d59a5872eb12ac826.tar.gz
www-66c705567234ea566d93fb0d59a5872eb12ac826.tar.bz2
www-66c705567234ea566d93fb0d59a5872eb12ac826.zip
use i18n logic from site generator
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile35
1 files changed, 3 insertions, 32 deletions
diff --git a/Makefile b/Makefile
index 021d582c..3b891920 100644
--- a/Makefile
+++ b/Makefile
@@ -2,40 +2,11 @@
include build-system/config.mk
-# List of all supported languages, add new languages here!
-LANGUAGES="en ar zh_Hant fr de hi it ja ko pt pt_BR ru es sv tr"
-
# All: build HTML pages in all languages and compile the
.PHONY: all
-all: locale template
- env BASEURL=$(opt_baseurl) ./inc/make_site.py
-
-# Extract translateable strings from jinja2 templates.
-locale/messages.pot: template/*.j2 template/news/*.j2 common/*.j2 common/*.j2.inc
- env PYTHONPATH=$$PWD/inc:$$PYTHONPATH $(pybabel) extract -F locale/babel.map -o locale/messages.pot .
-
-# Update translation (.po) files with new strings.
-.PHONY: locale-update
-locale-update: locale/messages.pot
- for lang in `echo $(LANGUAGES)`; do \
- $(msgmerge) -q -U -m --previous locale/$$lang/LC_MESSAGES/messages.po locale/messages.pot ; \
- done
- if $(grep) -nA1 '#-#-#-#-#' locale/*/LC_MESSAGES/messages.po; then \
- $(echo) -e "\nERROR: Conflicts encountered in PO files.\n"; \
- exit 1; \
- fi
-
-# Compile translation files for use.
-.PHONY: locale-compile
-locale-compile:
- for lang in `echo $(LANGUAGES)`; do \
- echo compiling $$lang; \
- $(pybabel) -q compile -d locale -l $$lang --use-fuzzy ; \
- done
-
-# Process everything related to gettext translations.
-.PHONY: locale
-locale: locale-update locale-compile
+all:
+ ./inc/update-messages
+ env "BASEURL=$(opt_baseurl)" ./inc/build-site
.PHONY: run
run: all