aboutsummaryrefslogtreecommitdiffstats
path: root/devtools/compile_translations.sh
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2015-02-14 16:02:11 -0600
committerChristopher Allan Webber <cwebber@dustycloud.org>2015-02-14 16:02:11 -0600
commitaac69eb9aa4c6510440f42956543997f01c32c0f (patch)
tree8b62aff2d030a8923559a968b87a6f2bcf1c0470 /devtools/compile_translations.sh
parent33cdeef94fe7c71f4a094ef224fc7d499b40717c (diff)
downloadmediagoblin-aac69eb9aa4c6510440f42956543997f01c32c0f.tar.lz
mediagoblin-aac69eb9aa4c6510440f42956543997f01c32c0f.tar.xz
mediagoblin-aac69eb9aa4c6510440f42956543997f01c32c0f.zip
choose pybabel depending on whether one is available in the environment
This commit sponsored by Erik Mekhsian. Thank you!
Diffstat (limited to 'devtools/compile_translations.sh')
-rwxr-xr-xdevtools/compile_translations.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/devtools/compile_translations.sh b/devtools/compile_translations.sh
index 7ce0cb79..fa84e9a7 100755
--- a/devtools/compile_translations.sh
+++ b/devtools/compile_translations.sh
@@ -19,6 +19,13 @@
# exit if anything fails
set -e
+if [ -f "./bin/pybabel" ]; then
+ PYBABEL="./bin/pybabel";
+else
+ PYBABEL=pybabel;
+fi
+
+
## This used to be a lot simpler...
##
## But now we have a Lojban translation that we can't compile
@@ -30,9 +37,9 @@ for file in `find mediagoblin/i18n/ -name "*.po"`; do
if [ "$file" != "mediagoblin/i18n/jbo/mediagoblin.po" ] && \
[ "$file" != "mediagoblin/i18n/templates/en/mediagoblin.po" ]; then
mkdir -p `dirname $file`/LC_MESSAGES/;
- ./bin/pybabel compile -i $file \
- -o `dirname $file`/LC_MESSAGES/mediagoblin.mo \
- -l `echo $file | awk -F / '{ print $3 }'`;
+ $PYBABEL compile -i $file \
+ -o `dirname $file`/LC_MESSAGES/mediagoblin.mo \
+ -l `echo $file | awk -F / '{ print $3 }'`;
else
echo "Skipping $file which pybabel can't compile :(";
fi;