aboutsummaryrefslogtreecommitdiffhomepage
path: root/GNUmakefile
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2025-07-27 22:00:20 +0200
committerThomas Voss <mail@thomasvoss.com> 2025-07-27 22:00:20 +0200
commit3f7e149694f52d606fce11e3a279e8a278e2e0fd (patch)
treeee2ddb6431e50ce70108f8b0c59969fa71f90d73 /GNUmakefile
parentfeb15f6f7714cb6cee72b2fd66b85baa5f8a90f2 (diff)
Fix things related to the translations system
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile20
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