forked from ekQ/ancestryai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
babel.sh
31 lines (28 loc) · 892 Bytes
/
babel.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
#!/bin/bash
if [ -z "$EDITOR" ]; then
EDITOR=vim
fi
if hash pybabel; then
echo "pybabel found"
else
echo "pybabel not found"
exit
fi
if [ -z "$@" ]; then
echo "usage:"
echo "sh babel.sh init"
echo " initializes translation files. If you already had the files, you want to"
echo " update instead."
echo "sh babel.sh update"
echo " updates the translation files for new translations."
elif [ "$1" = "init" ]; then
pybabel extract -F babel.cfg -o messages.pot .
pybabel init -i messages.pot -d main/translations -l "fi"
$EDITOR main/translations/*/*/messages.po
pybabel compile -d main/translations
elif [ "$1" = "update" ]; then
pybabel extract -F babel.cfg -o messages.pot .
pybabel update -i messages.pot -d main/translations
$EDITOR main/translations/*/*/messages.po
pybabel compile -d main/translations
fi