forked from OpenPLi/enigma2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.am
47 lines (36 loc) · 1.62 KB
/
Makefile.am
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
dist_noinst_SCRIPTS = xml2po.py
LANGS = ar bg ca cs da de el en es et fa fi fr fy gl he hr hu id is it ku lt lv mk nl nb nn pl pt pt_BR ro ru sk sl sr sv th tr uk vi zh_CN zh_HK
LANGMO = $(LANGS:=.mo)
LANGPO = $(LANGS:=.po)
EXTRA_DIST = $(LANGPO)
if UPDATE_PO
# the TRANSLATORS: allows putting translation comments before the to-be-translated line.
enigma2-py.pot: $(top_srcdir)/lib/python/*.py $(top_srcdir)/lib/python/*/*.py $(top_srcdir)/lib/python/*/*/*.py $(top_srcdir)/lib/python/Plugins/*/*/*.py
$(XGETTEXT) --no-wrap -L Python --from-code=UTF-8 -kpgettext:1c,2 --add-comments="TRANSLATORS:" -d @PACKAGE_NAME@ -s -o $@ $^
$(SED) --in-place $@ --expression=s/CHARSET/UTF-8/
enigma2-xml.pot: $(srcdir)/xml2po.py $(top_srcdir)/data/*.xml $(top_srcdir)/lib/python/Plugins/SystemPlugins/*/*.xml
$(PYTHON) $^ > $@
enigma2.pot: enigma2-py.pot enigma2-xml.pot
cat $^ | $(MSGUNIQ) --no-wrap --no-location -o $@ -
%.po: enigma2.pot
if [ -f $@ ]; then \
$(MSGMERGE) --backup=none --no-wrap --no-location -s -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) enigma2-py.pot enigma2-xml.pot enigma2.pot
dist-hook: $(LANGPO)
install-data-local: $(LANGMO)
for lang in $(LANGS); do \
$(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/po/$$lang/LC_MESSAGES; \
$(INSTALL_DATA) $$lang.mo $(DESTDIR)$(pkgdatadir)/po/$$lang/LC_MESSAGES/@[email protected]; \
done
uninstall-local:
for lang in $(LANGS); do \
$(RM) $(DESTDIR)$(pkgdatadir)/po/$$lang/LC_MESSAGES/@[email protected]; \
done