mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 14:30:30 +03:00 
			
		
		
		
	The Python argparse library has its own strings, which are translatable via gettext. This gets those sources strings from the library, and includes them in this project. Since gettext is invoked and configured in fdroidserver, fdroidserver needs to handle the translations for the libraries it uses.
		
			
				
	
	
		
			40 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			Makefile
		
	
	
	
	
	
 | 
						|
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 = de es pt_BR pt_PT tr zh_Hans zh_Hant
 | 
						|
POFILES = $(ALL_LINGUAS:=/LC_MESSAGES/fdroidserver.po)
 | 
						|
MOFILES = $(ALL_LINGUAS:=/LC_MESSAGES/fdroidserver.mo)
 | 
						|
 | 
						|
TEMPLATE = fdroidserver.pot
 | 
						|
 | 
						|
VERSION = $(shell git describe)
 | 
						|
 | 
						|
# generate .mo files from the .po files
 | 
						|
all-local: $(MOFILES)
 | 
						|
 | 
						|
clean-local:
 | 
						|
	-rm -f -- $(MOFILES)
 | 
						|
	-rm -f -- $(POFILES:=~)
 | 
						|
 | 
						|
# refresh the template from the source code
 | 
						|
template: $(TEMPLATE)
 | 
						|
 | 
						|
$(TEMPLATE): $(FILES)
 | 
						|
	xgettext --join-existing --from-code=UTF-8 \
 | 
						|
		--language=Python --keyword=_ \
 | 
						|
		--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)
 | 
						|
 | 
						|
%/LC_MESSAGES/fdroidserver.mo: %/LC_MESSAGES/fdroidserver.po
 | 
						|
	msgfmt --check -o $@ $(@:mo=po)
 | 
						|
 | 
						|
 | 
						|
.PHONY = all-local clean-local template
 |