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