-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathupdatelocdb.sh
executable file
·43 lines (27 loc) · 1.01 KB
/
updatelocdb.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
#!/bin/bash
# Updates localization information in the database with the information found in files.
# Must be run in Bible OL installation directory.
echo -n "You are about to change the contents of the database. Are you sure? (yes/no) "
read a
[ x$a != xyes ] && exit 1
# Interface localization
echo "# Updating interface localization"
iflangs=$(ls myapp/language/langsrc)
for lcode in $iflangs; do
echo "# Language code: $lcode"
php index.php translate if_php2db $lcode myapp/language/langsrc/$lcode
done
# Grammar localization
echo
echo "# Updating grammar localization"
php index.php translate gram_prop2db
# Lexicon localization
echo
echo "# Updating lexicon localization"
# Expects all csv files to be present
for file in lexicons/*.csv; do
srclang=$(echo $file | sed -e 's|lexicons/\([^_]*\)_\(.*\)\.csv|\1|')
dstlang=$(echo $file | sed -e 's|lexicons/\([^_]*\)_\(.*\)\.csv|\2|')
echo "# Updating $srclang -> $dstlang"
php index.php translate import_lex $srclang $dstlang $file
done