forked from OpenPLi/enigma2-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rules-po.mak
46 lines (35 loc) · 1.32 KB
/
Rules-po.mak
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
CATEGORY ?= "Extensions"
plugindir = $(libdir)/enigma2/python/Plugins/$(CATEGORY)/$(PLUGIN)
LANGMO = $(LANGS:=.mo)
LANGPO = $(LANGS:=.po)
if UPDATE_PO
# the TRANSLATORS: allows putting translation comments before the to-be-translated line.
$(PLUGIN)-py.pot: $(srcdir)/../src/*.py
$(XGETTEXT) -L python --from-code=UTF-8 --add-comments="TRANSLATORS:" -d $(PLUGIN) -s -o $@ $^; \
$(SED) --in-place $@ --expression=s/CHARSET/UTF-8/;
$(PLUGIN)-xml.pot: $(top_srcdir)/xml2po.py $(srcdir)/../src/*.xml
$(PYTHON) $^ > $@
$(PLUGIN).pot: $(PLUGIN)-py.pot $(PLUGIN)-xml.pot
cat $^ | $(MSGUNIQ) --no-location -o $@ -
%.po: $(PLUGIN).pot
if [ -f $@ ]; then \
$(MSGMERGE) --backup=none --no-location -s -N -U $@ $< && touch $@; \
$(MSGATTRIB) --no-wrap --no-obsolete $@ -o $@; \
else \
$(MSGINIT) -l $@ -o $@ -i $< --no-translator; \
fi
endif
.po.mo:
$(MSGFMT) -o $@ $<
BUILT_SOURCES = $(LANGMO)
CLEANFILES = $(LANGMO) $(PLUGIN)-py.pot $(PLUGIN)-xml.pot $(PLUGIN).pot
dist-hook: $(LANGPO)
install-data-local: $(LANGMO)
for lang in $(LANGS); do \
$(mkinstalldirs) $(DESTDIR)$(plugindir)/locale/$$lang/LC_MESSAGES; \
$(INSTALL_DATA) $$lang.mo $(DESTDIR)$(plugindir)/locale/$$lang/LC_MESSAGES/$(PLUGIN).mo; \
done
uninstall-local:
for lang in $(LANGS); do \
$(RM) $(DESTDIR)$(plugindir)/locale/$$lang/LC_MESSAGES/$(PLUGIN).mo; \
done