2
# Update the translation files with strings used in QGIS
3
# 1. create a clean Qt .pro file for the project
4
# 2. run lupdate using the .pro file from step 1
6
# Note the .pro file must NOT be named qgis.pro as this
7
# name is reserved for the Windows qmake project file
8
# update_ts_files.sh,v 1.3 2004/07/14 18:16:24 gsherman Exp
14
#first tar the qt_xx.ts files in i18n folder such that lupdate does not
15
#merge the qgis strings to them
16
echo Creating qt_ts.tar
17
tar --remove-files -cvf i18n/qt_ts.tar i18n/qt_*.ts
21
if [ -f "i18n/qgis_$i.ts" ]; then
22
exclude="$exclude --exclude i18n/qgis_$i.ts"
27
if [ -n "$exclude" ]; then
28
tar --remove-files -cvf i18n/qgis_ts.tar i18n/qgis_*.ts$exclude
30
echo Updating python translations
32
pylupdate4 utils.py -ts python-i18n.ts
33
perl ../scripts/ts2cpp.pl python-i18n.ts python-i18n.cpp
36
for i in python/plugins/*/CMakeLists.txt; do
38
pylupdate4 $(find . -name "*.py" -o -name "*.ui") -ts python-i18n.ts
39
perl ../../../scripts/ts2cpp.pl python-i18n.ts python-i18n.cpp
43
echo Creating qmake project file
44
qmake -project -o qgis_ts.pro -nopwd src python i18n
45
echo Updating translation files
46
lupdate$opts -verbose qgis_ts.pro
47
echo Removing temporary python translation files
48
perl -i.bak -ne 'print unless /^\s+<location.*python-i18n\.cpp.*$/;' i18n/qgis_*.ts
49
rm python/python-i18n.cpp python/plugins/*/python-i18n.cpp i18n/qgis_*.ts.bak
50
echo Removing qmake project file
52
echo Unpacking qt_ts.tar
53
tar -xvf i18n/qt_ts.tar
55
if [ -f i18n/qgis_ts.tar ]; then
56
echo Unpacking i18n/qgis_ts.tar
57
tar -xvf i18n/qgis_ts.tar