-
-
Notifications
You must be signed in to change notification settings - Fork 40
/
update_from_transifex.sh
executable file
·62 lines (50 loc) · 1.18 KB
/
update_from_transifex.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env bash
LOCALES_DIR="$(dirname $0)"
export LOCALES_BRANCH=$(git branch | grep \* | cut -d ' ' -f2 | sed -r 's/_/-/g')
export AVAILABLE_LOCALES="es fi fr it wq ja pt ru cs uk_UA"
usage()
{
echo "$0 [options] [locale]"
echo ""
echo "This script pull translations from transifex. It pull translations"
echo "of all languages or only the one given in parameter."
echo ""
echo "Options:"
echo " -f force to update translations, regardless of whether timestamps"
echo " on the local computer are newer than those on the server"
echo " "
}
FORCE=""
ALL_LOCALES=""
for i in $*
do
case $i in
-h|--help)
usage
exit 0
;;
-f|--force)
FORCE="-f"
;;
-*)
echo "ERROR: Unknown option: $i"
echo ""
usage
exit 1
;;
*)
if [ "$ALL_LOCALES" = "" ]; then
ALL_LOCALES="$i"
else
echo "ERROR: Two many arguments"
usage
exit 3
fi
;;
esac
done
if [ "$ALL_LOCALES" == "" ]; then
ALL_LOCALES=$(echo "$AVAILABLE_LOCALES" | sed -r 's/ /,/g')
fi
echo $ALL_LOCALES $LOCALES_BRANCH
tx -H $TX_API -t $TX_TOKEN pull $FORCE --mode default -l "$ALL_LOCALES"