chiark / gitweb /
Merge branch 'nightly' into 'master'
[fdroidserver.git] / locale / Makefile
1
2 FILES = ../fdroid $(wildcard ../fdroidserver/*.py) \
3         $(wildcard /usr/lib/python3.*/argparse.py) \
4         $(wildcard /usr/lib/python3.*/optparse.py) \
5         $(wildcard /usr/lib/python3.*/getopt.py)
6
7 # these are the supported languages
8 ALL_LINGUAS = de es pt_BR pt_PT tr zh_Hans zh_Hant
9 POFILES = $(wildcard */LC_MESSAGES/fdroidserver.po)
10 MOFILES = $(ALL_LINGUAS:=/LC_MESSAGES/fdroidserver.mo)
11
12 TEMPLATE = fdroidserver.pot
13
14 VERSION = $(shell git describe)
15
16 # refresh everything from the source code
17 update: $(POFILES)
18
19 # generate .mo files from the .po files
20 compile: $(MOFILES)
21
22 clean:
23         -rm -f -- $(MOFILES)
24         -rm -f -- $(POFILES:=~)
25
26 $(TEMPLATE): $(FILES)
27         xgettext --join-existing --from-code=UTF-8 \
28                 --language=Python --keyword=_ \
29                 --sort-output --add-location=file --output=$(TEMPLATE) \
30                 --package-name="fdroidserver" --package-version=$(VERSION) \
31                 --foreign-user \
32                 --msgid-bugs-address=https://gitlab.com/fdroid/fdroidserver/issues \
33                 $(FILES)
34         sed -i 's,CHARSET,UTF-8,' $(TEMPLATE)
35
36 %.po: $(TEMPLATE)
37         msgmerge --sort-output --add-location=file --update $@ $(TEMPLATE)
38
39 %/LC_MESSAGES/fdroidserver.mo: %/LC_MESSAGES/fdroidserver.po
40         msgfmt --check -o $@ $(@:mo=po)
41
42
43 .PHONY = compile clean update