summaryrefslogtreecommitdiff
path: root/l10n/Makefile
blob: fd0b0003a21352697e16bd2165846ada4845810f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Add only languages really supported by NSIS there
# For others, a PO file may be added and kept until NSIS is translated
# Languages not yet supported by NSIS: ast bn dz kk ml ta te ug vi
LINGUAS= ar be bg bs ca cs da de el en eo es eu fa fi fr ga gl he hr hu is it ja ko lt nb nl pl pt pt_BR ro ru sk sl sq sr sr@latin sv th tr uk zh_CN zh_TW

all: templates/all.nsh templates/dialog.nsh po/messages.pot

templates/dialog.nsh: templates/all.nsh
	for i in $(LINGUAS) ; do \
		echo "Push \$${`LANGUAGE=$$i ./win32-loader.sh LANG_ENGLISH`}" ; \
		echo "Push \"`LANGUAGE=$$i ./win32-loader.sh English`\"" ; \
	done > $@

templates/all.nsh: $(foreach lang, $(LINGUAS), templates/$(lang).nsh)
	for i in $^ ; do echo "; BEGIN $$i" ; cat $$i ; echo "; END $$i" ; done > $@

win32-loader: win32-loader.c
	gcc -DTEXTDOMAINDIR=\"$(CURDIR)/locale\" $^ -o $@

templates/en.nsh: win32-loader.sh win32-loader
	mkdir -p templates
	LANGUAGE=C ./win32-loader.sh > $@

templates/%.nsh: po/%.po win32-loader.sh win32-loader po/messages.pot
	mkdir -p templates locale/$*/LC_MESSAGES
	msgmerge -U po/$*.po po/messages.pot
	msgfmt -c --statistics -o locale/$*/LC_MESSAGES/win32-loader.mo $<
	LANGUAGE=$* ./win32-loader.sh > $@

po/messages.pot: win32-loader.sh win32-loader.c
	xgettext --msgid-bugs-address=win32-loader@packages.debian.org --from-code=utf-8 -ctranslate --keyword=_ $^ -o $@

clean:
	rm -rf *~ templates locale win32-loader