-
Notifications
You must be signed in to change notification settings - Fork 29
/
extract-messages.sh
executable file
·37 lines (33 loc) · 1.29 KB
/
extract-messages.sh
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
#!/bin/sh
. ./etc/translation.vars
[ -f ./etc/translation.vars.custom ] && . ./etc/translation.vars.custom
export TZ=UTC
if [ ! -e $POTDIR ]; then
mkdir $POTDIR
fi
# By setting the PYTHONPATH here we can help pybabel find 'our' highlighting
# extension and we can use any pybabel
export PYTHONPATH=i2p2www:$PYTHONPATH
if [ $# -ge 1 ]
then
$PYBABEL extract --msgid-bugs-address="http://trac.i2p2.de" \
--project=$PROJECT \
--version=$VERSION \
-F $BABELCFG/$1 \
-o $POTDIR/$1.pot $PROJDIR
else
for domain in $(ls $BABELCFG); do
if [ -e $POTDIR/$domain.pot ]; then
mv $POTDIR/$domain.pot $POTDIR/$domain.pot.old
fi
$PYBABEL extract --msgid-bugs-address="http://trac.i2p2.de" \
--project=$PROJECT \
--version=$VERSION \
-F $BABELCFG/$domain \
-o $POTDIR/$domain.pot $PROJDIR
diff -u $POTDIR/$domain.pot.old $POTDIR/$domain.pot | grep '^+' | grep -v '^+++' | grep -v '+"POT-Creation-Date' >/dev/null
if [ $? -eq 1 ]; then
mv $POTDIR/$domain.pot.old $POTDIR/$domain.pot
fi
done
fi