aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 07f3532ec201a383c362422ad5e634c8303634cf (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
export SHELL = sh

PACKAGE = mime-editor-gui

all:

pot:
	mkdir -p ./po
	find . -iname "*.py" | xargs xgettext --default-domain="$(PACKAGE)" --sort-output --output="./po/$(PACKAGE).pot"
	find . -iname "*.glade" | xargs xgettext --join-existing --sort-output -L Glade -k_ -kN_ --keyword=translatable --output="./po/$(PACKAGE).pot"

	sed -i 's/CHARSET/UTF-8/' po/$(PACKAGE).pot
	sed -i 's/PACKAGE VERSION/$(PACKAGE) $(VERSION)/' po/$(PACKAGE).pot
	sed -i 's/PACKAGE/$(PACKAGE)/' po/$(PACKAGE).pot

update-po: pot
	for i in po/*.po ;\
	do \
	mv $$i $${i}.old ; \
	(msgmerge $${i}.old po/$(PACKAGE).pot | msgattrib --no-obsolete > $$i) ; \
	rm $${i}.old ; \
	done

translations: ./po/*.po
	mkdir -p locale
	@for po in $^; do \
		language=`basename $$po`; \
		language=$${language%%.po}; \
		target="locale/$$language/LC_MESSAGES"; \
		mkdir -p $$target; \
		msgfmt --output=$$target/$(PACKAGE).mo $$po; \
	done
bgstack15