linkchecker/po/Makefile
Chris Mayo e297b1a477 Stop including binary translation catalogs in the source
Makes it easier to contribute and accept translations.

Does add a new dependency on installation from source, polib. This is
not made mandatory because not all users will want translations.

polib has no further dependencies and can be installed anywhere
LinkChecker can, using pip too.

Add release process step to check polib is installed

The Wheel still includes translations. Recommend install from PyPI in
the README.

Translations were being compiled in setup.py until 2014, using a bundled
copy of msgfmt.py.
9c3739f1c ("Replace msgfmt.py with local tools.", 2014-09-08)
2021-11-22 19:30:33 +00:00

33 lines
856 B
Makefile

XGETTEXT := xgettext
MSGFMT := msgfmt
MSGMERGE := msgmerge
POSOURCES = $(shell find ../linkcheck -name \*.py) \
../linkchecker $(shell python3 -c 'import argparse; print(argparse.__file__)')
PACKAGE = linkchecker
TEMPLATE = $(PACKAGE).pot
MYMAIL := bastian.kleineidam@web.de
BUGSURL = https://github.com/linkchecker/linkchecker
POFILES = $(wildcard *.po)
all: $(POFILES)
%.po: $(TEMPLATE)
$(MSGMERGE) -U --suffix=.bak $@ $<
template: $(TEMPLATE)
$(TEMPLATE): $(POSOURCES)
$(XGETTEXT) -w 80 --default-domain=$(PACKAGE) --language=Python \
--copyright-holder="Bastian Kleineidam <$(MYMAIL)>" \
--package-name=LinkChecker \
--msgid-bugs-address=$(BUGSURL) -o $(TEMPLATE) \
--keyword=_n:1,2 $(POSOURCES)
check:
@for po in $(POFILES); do \
$(MSGFMT) -cv --statistics -o - $$po >/dev/null; \
done
clean:
rm -f *.bak
.PHONY: check clean