add support for custom localizations and german translation
[vuplus_dvbapp-plugin] / movieretitle / po / Makefile.am
1 #
2 # to use this for the localisation of other plugins,
3 # just change the DOMAIN to the name of the Plugin.
4 # It is assumed, that the domain ist the same as
5 # the directory name of the plugin.
6 #
7
8 DOMAIN=MovieRetitle
9 installdir = /usr/lib/enigma2/python/Plugins/Extensions/$(DOMAIN)
10 #GETTEXT=./pygettext.py
11 GETTEXT=xgettext
12
13 #MSGFMT = ./msgfmt.py
14 MSGFMT = msgfmt
15
16 LANGS := de
17 LANGPO := $(foreach LANG, $(LANGS),$(LANG).po)
18 LANGMO := $(foreach LANG, $(LANGS),$(LANG).mo)
19
20 default: $(DOMAIN).pot $(LANGPO) merge $(LANGMO)
21         for lang in $(LANGS); do \
22                 mkdir -p $$lang/LC_MESSAGES; \
23                 cp $$lang.mo $$lang/LC_MESSAGES/$(DOMAIN).mo; \
24         done
25
26 merge:
27         for lang in $(LANGS); do \
28                 msgmerge --no-location -s -N -U $$lang.po $(DOMAIN).pot; \
29         done
30
31
32 # the TRANSLATORS: allows putting translation comments before the to-be-translated line.
33 $(DOMAIN).pot:
34         $(GETTEXT) -L python --add-comments="TRANSLATORS:" -d $(DOMAIN) -s -o $(DOMAIN).pot ../src/*.py
35         msguniq -o $(DOMAIN)uniq.pot $(DOMAIN).pot
36         $(RM) $(DOMAIN).pot
37         mv $(DOMAIN)uniq.pot $(DOMAIN).pot
38
39 .PHONY: $(DOMAIN).pot
40
41
42 %.mo: %.po
43         $(MSGFMT) -o $@ $<
44
45 %.po:
46         msginit -l $@ -o $@ -i $(DOMAIN).pot --no-translator
47
48 CLEANFILES = $(foreach LANG, $(LANGS),$(LANG).mo)
49
50 clean-local:
51         $(RM) -r $(LANGS)
52
53 install-data-am: default
54         for lang in $(LANGS); do \
55                 mkdir -p $(DESTDIR)$(installdir)/locale/$$lang/LC_MESSAGES; \
56                 cp $$lang.mo $(DESTDIR)$(installdir)/locale/$$lang/LC_MESSAGES/$(DOMAIN).mo; \
57         done