-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.translations
44 lines (34 loc) · 1.54 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
DOMAIN=enigma2
GETTEXT=xgettext
PODIR=po
# The languages to build
languages := am 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 sq sr tr uk
.PHONY: default init submodule_init submodule_update update template merge
default: update
init: submodule_init submodule_update
submodule_init:
git submodule init
submodule_update:
git submodule update --recursive --remote
update: init template merge
template:
find ./enigma2 ./enigma2-skins -iname "*.py" | xargs $(GETTEXT) -L Python --from-code=UTF-8 --add-comments="TRANSLATORS:" -d enigma2 -s -o $(PODIR)/enigma2.pot
find ./enigma2 -iname "*.xml" | xargs ./scripts/xml2po.py >> $(PODIR)/enigma2.pot
find ./enigma2 ./enigma2-skins -iname "plugin_*.xml" | xargs ./scripts/meta2po.py >> $(PODIR)/enigma2.pot
find ./enigma2-skins -iname "skin_*.xml" | grep -v skin_default.* | xargs ./scripts/xml2po.py >> $(PODIR)/enigma2.pot
msguniq -n --add-location -o $(PODIR)/enigma2.pot $(PODIR)/enigma2.pot
merge:
for lang in $(languages); do \
echo "merging catalog for $${lang}"; \
msgmerge --add-location -s -N -U "$(PODIR)/$$lang.po" "$(PODIR)/enigma2.pot"; \
msgattrib --output-file=$(PODIR)/$$lang.po --no-obsolete $(PODIR)/$$lang.po; \
done
rm -f $(PODIR)/*.po~
rm -f $(PODIR)/*.pending
mergeold :
mkdir -p $(PODIR)
for pofile in ./oldpo/*.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