-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile.translations
46 lines (37 loc) · 1.47 KB
/
Makefile.translations
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
DOMAIN:=enigma2-plugins
LANGS:=ar ca cs ckb da de el en es et fi fa fr fy he hr hu is it lt lv nl no pl pt pt_BR ru sv sk sl sr tr uk
GETTEXT=xgettext
PODIR:=po
POTFILE:=$(PODIR)/$(DOMAIN).pot
.PHONY: default catalog update template msgmerge merge
default: catalog
catalog : update template msgmerge merge
XMLPODIRS := enigma2-plugins/autotimer/src/ enigma2-plugins/epgrefresh/src/ enigma2-plugins/pipzap/src/ enigma2-plugins/pluginsort/src/
update:
git pull
git submodule init
git submodule update --recursive --remote
template:
mkdir -p $(PODIR)
find ./ -iname "*.py" | xargs $(GETTEXT) -L Python --from-code=UTF-8 --add-comments="TRANSLATORS:" -d $(DOMAIN) -s -o $(POTFILE)
find ./ -iname "plugin_*.xml" | xargs ./scripts/meta2po.py >> $(POTFILE)
./scripts/xml2po.py $(XMLPODIRS) >> $(POTFILE)
msguniq -n --add-location -o $(POTFILE) $(POTFILE)
msgmerge:
mkdir -p $(PODIR)
for lang in $(LANGS); do \
echo "merging catalog for $${lang}"; \
if [ -e ${PODIR}/$$lang.po ]; then \
msgmerge --add-location --force-po -s -N -U "$(PODIR)/$$lang.po" "$(POTFILE)"; \
msgattrib --output-file=$(PODIR)/$$lang.po --no-obsolete $(PODIR)/$$lang.po; \
fi; \
done
rm -f ${PODIR}/*.po~
rm -f ${PODIR}/*.pending
merge :
mkdir -p $(PODIR)
for pofile in */po/*.po; do \
echo "merging $${pofile} into ${PODIR}/$${pofile##*/}"; \
touch $(PODIR)/$${pofile##*/}; \
msgcat --add-location --force-po --use-first -s $(PODIR)/$${pofile##*/} $${pofile} -o $(PODIR)/$${pofile##*/}; \
done