choose pybabel depending on whether one is available in the environment
authorChristopher Allan Webber <cwebber@dustycloud.org>
Sat, 14 Feb 2015 22:02:11 +0000 (16:02 -0600)
committerChristopher Allan Webber <cwebber@dustycloud.org>
Sat, 14 Feb 2015 22:02:11 +0000 (16:02 -0600)
This commit sponsored by Erik Mekhsian.  Thank you!

devtools/compile_translations.sh

index 7ce0cb7961274530a5540816a1056bf6d5f34a8e..fa84e9a7d19412e0732a99edc0001cb8049e7332 100755 (executable)
 # 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;