]> git.ipfire.org Git - people/shoehn/ipfire.org.git/blob - Makefile
Bootstrap 4 migration: downloads.dev.ipfire.org
[people/shoehn/ipfire.org.git] / Makefile
1
2 PO_PATH = translations
3 POTFILE = $(PO_PATH)/webapp.pot
4 POFILES = $(wildcard $(PO_PATH)/*/LC_MESSAGES/*.po)
5
6 ALL_FILES = $(shell find webapp templates /usr/lib*/python*/site-packages/tornado -name "*.py" -or -name "*.html")
7
8 .PHONY: pot
9 pot: $(POTFILE)
10
11 $(POTFILE): $(ALL_FILES)
12 xgettext --language=Python --from-code=UTF-8 --keyword=_:1,2 --keyword=N_ -d pakfire -o $(POTFILE) \
13 $(ALL_FILES)
14
15 .PHONY: po
16 po: $(POTFILE) $(patsubst %.po, %.mo, $(POFILES))
17
18 %.po: $(POTFILE)
19 # Merge the POTFILE.
20 msgmerge $@ $(POTFILE) -o $@
21
22 %.mo: %.po
23 # Compile the translations.
24 msgfmt $< -o $@