summaryrefslogtreecommitdiff
path: root/meta-openvuplus/recipes-vuplus/enigma2/enigma2-plugins/Makefile.am
blob: c6e5fb46b527207aeeeef02157420a0b07d3eb87 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#
# to use this for the localisation of other plugins,
# just change the DOMAIN to the name of the Plugin.
# It is assumed, that the domain ist the same as
# the directory name of the plugin.
#

DOMAIN=EasyMedia
installdir = /usr/lib/enigma2/python/Plugins/Extensions/$(DOMAIN)
#GETTEXT=./pygettext.py
GETTEXT=xgettext

#MSGFMT = ./msgfmt.py
MSGFMT = msgfmt

LANGS := de it nl
LANGPO := $(foreach LANG, $(LANGS),$(LANG).po)
LANGMO := $(foreach LANG, $(LANGS),$(LANG).mo)

default: $(DOMAIN).pot $(LANGPO) merge $(LANGMO)
	for lang in $(LANGS); do \
		mkdir -p $$lang/LC_MESSAGES; \
		cp $$lang.mo $$lang/LC_MESSAGES/$(DOMAIN).mo; \
	done

merge:
	#for lang in $(LANGS); do msgmerge --no-location -s -N -U $$lang.po $(DOMAIN).pot; done


# the TRANSLATORS: allows putting translation comments before the to-be-translated line.
$(DOMAIN).pot:
	$(GETTEXT) -L python --add-comments="TRANSLATORS:" -d $(DOMAIN) -s -o $(DOMAIN).pot ../src/*.py
	for lang in $(LANGS); do msgmerge --no-location -s -N -U $$lang.po $(DOMAIN).pot; done
	msguniq -o $(DOMAIN)uniq.pot $(DOMAIN).pot
	$(RM) $(DOMAIN).pot
	mv $(DOMAIN)uniq.pot $(DOMAIN).pot

.PHONY: $(DOMAIN).pot


%.mo: %.po
	$(MSGFMT) -o $@ $<

%.po:
	msginit -l $@ -o $@ -i $(DOMAIN).pot --no-translator

CLEANFILES = $(foreach LANG, $(LANGS),$(LANG).mo)

clean-local:
	$(RM) -r $(LANGS)

install-data-am: default
	for lang in $(LANGS); do \
		mkdir -p $(DESTDIR)$(installdir)/locale/$$lang/LC_MESSAGES; \
		cp $$lang.mo $(DESTDIR)$(installdir)/locale/$$lang/LC_MESSAGES/$(DOMAIN).mo; \
	done