File tree 2 files changed +36
-28
lines changed
2 files changed +36
-28
lines changed Original file line number Diff line number Diff line change @@ -9,26 +9,4 @@ if [ -z "$1" ] ; then
9
9
exit 0
10
10
fi
11
11
12
- # Create a new .ts file for a new translation in qgis
13
- # 1. create a clean Qt .pro file for the project
14
- # 2. run lupdate using the .pro file from step 1
15
- # 3. remove the .pro
16
- # update_ts_files.sh,v 1.3 2004/07/14 18:16:24 gsherman Exp
17
-
18
- # first tar the qt_xx.ts files in i18n folder such that lupdate does not
19
- # merge the qgis strings to them
20
- QTDIR=/usr/
21
- echo Creating qt_ts.tar
22
- tar -cvf i18n/qt_ts.tar i18n/qt_* .ts
23
- rm i18n/qt_* .ts
24
- echo Creating qmake project file
25
- $QTDIR /bin/qmake -project -o qgis_ts.pro
26
- # add our new translation to the pro file
27
- echo " Creating new translation entry for $1 in the pro file"
28
- echo " TRANSLATIONS += i18n/qgis_${1} .ts" >> qgis_ts.pro
29
- echo Updating translation files
30
- $QTDIR /bin/lupdate -verbose qgis_ts.pro
31
- echo Removing qmake project file
32
- rm qgis_ts.pro
33
- echo Unpacking qt_ts.tar
34
- tar -xvf i18n/qt_ts.tar
12
+ $( dirname $0 ) /update_ts_files.sh -a $1
Original file line number Diff line number Diff line change @@ -51,14 +51,27 @@ echo Saving Qt translations
51
51
tar --remove-files -cf i18n/qt_ts.tar i18n/qt_* .ts
52
52
exclude=
53
53
opts=
54
- for i in " $@ " ; do
55
- if [ -f " i18n/qgis_$i .ts" ]; then
56
- exclude=" $exclude --exclude i18n/qgis_$i .ts"
54
+ while (( $# > 0 )) ; do
55
+ arg=$1
56
+ shift
57
+
58
+ if [ " $arg " = " -a" ]; then
59
+ arg=$1
60
+ shift
61
+ if [ -f " i18n/qgis_$arg .ts" ]; then
62
+ echo " cannot add existing tranlation $arg "
63
+ exit 1
64
+ else
65
+ add=" $add $arg "
66
+ fi
67
+ elif [ -f " i18n/qgis_$arg .ts" ]; then
68
+ exclude=" $exclude --exclude i18n/qgis_$arg .ts"
57
69
else
58
- opts=" $i "
70
+ opts=" $opts $arg "
59
71
fi
60
72
done
61
- if [ -n " $exclude " ]; then
73
+
74
+ if [ -n " $exclude " -o -n " $add " ]; then
62
75
echo Saving excluded translations
63
76
tar --remove-files -cf i18n/qgis_ts.tar i18n/qgis_* .ts$exclude
64
77
fi
86
99
[ -f " $i " ] && mv " $i " " $i .save"
87
100
done
88
101
qmake -project -o qgis_ts.pro -nopwd src python i18n
102
+ if [ -n " $add " ]; then
103
+ for i in $add ; do
104
+ echo " Adding translation for $i "
105
+ echo " TRANSLATIONS += i18n/qgis_$i .ts" >> qgis_ts.pro
106
+ done
107
+ fi
89
108
echo Updating translations
90
109
lupdate$opts -verbose qgis_ts.pro
110
+
111
+ if [ -n " $add " ]; then
112
+ for i in $add ; do
113
+ if [ -f i18n/qgis_$i .ts ]; then
114
+ svn add i18n/qgis_$i .ts
115
+ else
116
+ echo " Translaiton for $i was not added"
117
+ exit 1
118
+ fi
119
+ done
120
+ fi
You can’t perform that action at this time.
0 commit comments