-
-
Notifications
You must be signed in to change notification settings - Fork 91
/
Copy pathupdate.sh
executable file
·39 lines (29 loc) · 906 Bytes
/
update.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
#!/bin/sh
set -e
ROOT=`pwd`
SRC=${ROOT}/src
TEMPLATE_PO="$ROOT/template.pot"
TEMPLATE_TS="$ROOT/template.ts"
BASE_LST_FILE="$ROOT/base_lst_file"
LCONVERT_BIN=${LCONVERT_BIN:-lconvert}
LRELEASE_BIN=${LRELEASE_BIN:-lrelease}
LUPDATE_BIN=${LUPDATE_BIN:-lupdate}
###############################################################################
echo "Writing lst file..."
cd $SRC
find -type f \( -iname \*.h -o -iname \*.cpp -o -iname \*.ui \) > $BASE_LST_FILE
cd $ROOT
echo " $(cat $BASE_LST_FILE | wc -l) files found"
echo "Generating new template..."
if [ -f $TEMPLATE_PO ]
then
echo " Converting .pot to .ts"
$LCONVERT_BIN -locations relative $TEMPLATE_PO -o $TEMPLATE_TS
fi
echo " Generating .ts"
rm -f "$TEMPLATE_TS"
cd $SRC
$LUPDATE_BIN "@$BASE_LST_FILE" -ts $TEMPLATE_TS
cd $ROOT
echo " Converting .ts to .pot"
$LCONVERT_BIN -locations relative $TEMPLATE_TS -o $TEMPLATE_PO