diff options
Diffstat (limited to 'GNUmakefile')
-rw-r--r-- | GNUmakefile | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/GNUmakefile b/GNUmakefile index e4fb99d..23f261b 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -8,18 +8,30 @@ templates := $(shell find src/templates -name '*.tmpl') exttmpl := $(wildcard cmd/exttmpl/*.go) +ENABLED_LANGUAGES := $(shell ./enabled-languages) + all: euro-cash.eu exttmpl euro-cash.eu: $(cssfiles) $(templates) $(gofiles) $(sqlfiles) $(GO) build po: exttmpl - find . -name '*.html.tmpl' -exec ./exttmpl -out po/templates.pot {} + - for bcp in en; \ + find . -name '*.go' -exec xgettext -Lgo --force-po --from-code=UTF-8 \ + -o po/backend.pot {} + + find . -name '*.html.tmpl' -exec ./exttmpl {} + \ + | msgcat po/backend.pot - -o po/messages.pot + for bcp in $(ENABLED_LANGUAGES); \ do \ - mkdir -p "po/$$bcp"; \ - msgmerge --update "po/$$bcp/messages.po" po/templates.pot; \ + dir="po/$$bcp"; \ + if [ ! -d "$$dir" ]; \ + then \ + mkdir -p "$$dir"; \ + msginit -i po/messages.pot -o "$$dir/messages.po" -l$$bcp.UTF-8 \ +--no-translator; \ + fi; \ + msgmerge --update "po/$$bcp/messages.po" po/messages.pot; \ done + find po -name '*~' -delete exttmpl: $(exttmpl) $(GO) build ./cmd/exttmpl |