<commit_before>
FILES = ../fdroid $(wildcard ../fdroidserver/*.py) \
	$(wildcard /usr/lib/python3.*/argparse.py) \
	$(wildcard /usr/lib/python3.*/optparse.py) \
	$(wildcard /usr/lib/python3.*/getopt.py)

# these are the supported languages
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
POFILES = $(wildcard */LC_MESSAGES/fdroidserver.po)
MOFILES = $(ALL_LINGUAS:=/LC_MESSAGES/fdroidserver.mo)

TEMPLATE = fdroidserver.pot

VERSION = $(shell git describe)

# refresh everything from the source code
update: $(POFILES)

# generate .mo files from the .po files
compile: $(MOFILES)

clean:
	-rm -f -- $(MOFILES)
	-rm -f -- $(POFILES:=~)

$(TEMPLATE): $(FILES)
	xgettext --join-existing --from-code=UTF-8 \
		--language=Python --keyword=_ \
		--no-wrap --sort-output --add-location=file --output=$(TEMPLATE) \
		--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)

%.po: $(TEMPLATE)
	msgmerge --no-wrap --sort-output --add-location=file --update $@ $(TEMPLATE)<commit_msg>point out the easy way to generate the locale files<commit_after>
FILES = ../fdroid $(wildcard ../fdroidserver/*.py) \
	$(wildcard /usr/lib/python3.*/argparse.py) \
	$(wildcard /usr/lib/python3.*/optparse.py) \
	$(wildcard /usr/lib/python3.*/getopt.py)

# these are the supported languages
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
POFILES = $(wildcard */LC_MESSAGES/fdroidserver.po)
MOFILES = $(ALL_LINGUAS:=/LC_MESSAGES/fdroidserver.mo)

TEMPLATE = fdroidserver.pot

VERSION = $(shell git describe)

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"

# refresh everything from the source code
update: $(POFILES)

# generate .mo files from the .po files
compile: message $(MOFILES)

clean:
	-rm -f -- $(MOFILES)
	-rm -f -- $(POFILES:=~)

$(TEMPLATE): $(FILES)
	xgettext --join-existing --from-code=UTF-8 \
		--language=Python --keyword=_ \
		--no-wrap --sort-output --add-location=file --output=$(TEMPLATE) \
		--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)

%.po: $(TEMPLATE)
	msgmerge --no-wrap --sort-output --add-location=file --update $@ $(TEMPLATE)
{'fraction_non_alphanumeric': 0.173861852433281, 'fraction_numerical': 0.003924646781789639, 'mean_word_length': 3.6177536231884058, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2044933', 'n_tokens_mistral': 1004, 'n_tokens_neox': 940, 'n_words': 225}