2017-09-15 23:39:32 +02:00
|
|
|
|
2017-10-13 14:50:22 +02:00
|
|
|
FILES = ../fdroid $(wildcard ../fdroidserver/*.py) \
|
|
|
|
$(wildcard /usr/lib/python3.*/argparse.py) \
|
|
|
|
$(wildcard /usr/lib/python3.*/optparse.py) \
|
|
|
|
$(wildcard /usr/lib/python3.*/getopt.py)
|
2017-09-15 23:39:32 +02:00
|
|
|
|
|
|
|
# these are the supported languages
|
2018-08-20 23:05:55 +02:00
|
|
|
ALL_LINGUAS = bo de es es_AR fa fr it ja kab ko nb_NO pt_BR pt_PT ru tr uk zh_Hans zh_Hant
|
2017-10-17 17:41:20 +02:00
|
|
|
POFILES = $(wildcard */LC_MESSAGES/fdroidserver.po)
|
2017-09-15 23:39:32 +02:00
|
|
|
MOFILES = $(ALL_LINGUAS:=/LC_MESSAGES/fdroidserver.mo)
|
|
|
|
|
|
|
|
TEMPLATE = fdroidserver.pot
|
|
|
|
|
|
|
|
VERSION = $(shell git describe)
|
|
|
|
|
2018-09-20 11:35:07 +02:00
|
|
|
default:
|
|
|
|
@printf "Build the translation files using: ./setup.py compile_catalog\n\n"
|
|
|
|
|
|
|
|
message:
|
|
|
|
@printf "\nYou probably want to use this instead: ./setup.py compile_catalog\n\n"
|
|
|
|
|
2017-10-19 18:02:00 +02:00
|
|
|
# refresh everything from the source code
|
|
|
|
update: $(POFILES)
|
|
|
|
|
2017-09-15 23:39:32 +02:00
|
|
|
# generate .mo files from the .po files
|
2018-09-20 11:35:07 +02:00
|
|
|
compile: message $(MOFILES)
|
2017-09-15 23:39:32 +02:00
|
|
|
|
2017-10-19 18:02:00 +02:00
|
|
|
clean:
|
2017-09-15 23:39:32 +02:00
|
|
|
-rm -f -- $(MOFILES)
|
|
|
|
-rm -f -- $(POFILES:=~)
|
|
|
|
|
|
|
|
$(TEMPLATE): $(FILES)
|
|
|
|
xgettext --join-existing --from-code=UTF-8 \
|
|
|
|
--language=Python --keyword=_ \
|
2018-02-13 09:17:28 +01:00
|
|
|
--no-wrap --sort-output --add-location=file --output=$(TEMPLATE) \
|
2017-09-15 23:39:32 +02:00
|
|
|
--package-name="fdroidserver" --package-version=$(VERSION) \
|
|
|
|
--foreign-user \
|
|
|
|
--msgid-bugs-address=https://gitlab.com/fdroid/fdroidserver/issues \
|
|
|
|
$(FILES)
|
|
|
|
sed -i 's,CHARSET,UTF-8,' $(TEMPLATE)
|
|
|
|
|
2017-10-17 17:41:20 +02:00
|
|
|
%.po: $(TEMPLATE)
|
2018-02-13 09:17:28 +01:00
|
|
|
msgmerge --no-wrap --sort-output --add-location=file --update $@ $(TEMPLATE)
|
2017-10-17 17:41:20 +02:00
|
|
|
|
2017-09-15 23:39:32 +02:00
|
|
|
%/LC_MESSAGES/fdroidserver.mo: %/LC_MESSAGES/fdroidserver.po
|
|
|
|
msgfmt --check -o $@ $(@:mo=po)
|
|
|
|
|
|
|
|
|
2017-10-19 18:02:00 +02:00
|
|
|
.PHONY = compile clean update
|