prefer the venv pybabel but allow the system one to be used (if found)
This commit is contained in:
@ -1,11 +1,13 @@
|
||||
#!/bin/sh
|
||||
. ./etc/translation.vars
|
||||
|
||||
export TZ=UTC
|
||||
|
||||
if [ $# -ge 1 ]
|
||||
then
|
||||
TZ=UTC env/bin/pybabel compile -D $1 -d $TRANSDIR
|
||||
$PYBABEL compile -D $1 -d $TRANSDIR
|
||||
else
|
||||
for domain in $(ls $BABELCFG); do
|
||||
TZ=UTC env/bin/pybabel compile -D $domain -d $TRANSDIR
|
||||
$PYBABEL compile -D $domain -d $TRANSDIR
|
||||
done
|
||||
fi
|
||||
|
@ -4,3 +4,12 @@ BABELCFG=etc/babel.cfg
|
||||
POTDIR=pots
|
||||
PROJDIR=i2p2www
|
||||
TRANSDIR=$PROJDIR/translations
|
||||
|
||||
if [ -x env/bin/pybabel ]; then
|
||||
PYBABEL=env/bin/pybabel
|
||||
elif [ $(which pybabel) ]; then
|
||||
PYBABEL=$(which pybabel)
|
||||
else
|
||||
echo "ERROR: pybabel was not found. Please run setup_venv.sh" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
@ -1,20 +1,26 @@
|
||||
#!/bin/sh
|
||||
. ./etc/translation.vars
|
||||
|
||||
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
|
||||
TZ=UTC ./pybabel extract --msgid-bugs-address="http://trac.i2p2.de" \
|
||||
$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
|
||||
TZ=UTC ./pybabel extract --msgid-bugs-address="http://trac.i2p2.de" \
|
||||
$PYBABEL extract --msgid-bugs-address="http://trac.i2p2.de" \
|
||||
--project=$PROJECT \
|
||||
--version=$VERSION \
|
||||
-F $BABELCFG/$domain \
|
||||
|
@ -1,10 +1,12 @@
|
||||
#!/bin/sh
|
||||
. ./etc/translation.vars
|
||||
|
||||
export TZ=UTC
|
||||
|
||||
if [ $# -ge 1 ]
|
||||
then
|
||||
for domain in $(ls $BABELCFG); do
|
||||
TZ=UTC env/bin/pybabel init -D $domain -i $POTDIR/$domain.pot -d $TRANSDIR -l $1
|
||||
$PYBABEL init -D $domain -i $POTDIR/$domain.pot -d $TRANSDIR -l $1
|
||||
done
|
||||
else
|
||||
echo "Usage: ./init-new-po.sh lang"
|
||||
|
@ -1,11 +1,12 @@
|
||||
#!/bin/sh
|
||||
. ./etc/translation.vars
|
||||
export TZ=UTC
|
||||
|
||||
if [ $# -ge 1 ]
|
||||
then
|
||||
TZ=UTC env/bin/pybabel update -D $1 -i $POTDIR/$1.pot -d $TRANSDIR
|
||||
$PYBABEL update -D $1 -i $POTDIR/$1.pot -d $TRANSDIR
|
||||
else
|
||||
for domain in $(ls $BABELCFG); do
|
||||
TZ=UTC env/bin/pybabel update -D $domain -i $POTDIR/$domain.pot -d $TRANSDIR
|
||||
$PYBABEL update -D $domain -i $POTDIR/$domain.pot -d $TRANSDIR
|
||||
done
|
||||
fi
|
||||
|
Reference in New Issue
Block a user