From 9535777ea1fecc36a54ae82cc3684bd5a300aa6a Mon Sep 17 00:00:00 2001 From: timlinux Date: Tue, 8 Jan 2008 13:41:25 +0000 Subject: [PATCH] Added script to create a .ts file for a new language git-svn-id: http://svn.osgeo.org/qgis/trunk@7866 c8812cc2-4d05-0410-92ff-de0c093fc19c --- scripts/create_new_ts.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 scripts/create_new_ts.sh diff --git a/scripts/create_new_ts.sh b/scripts/create_new_ts.sh new file mode 100755 index 00000000000..af1f9b29770 --- /dev/null +++ b/scripts/create_new_ts.sh @@ -0,0 +1,34 @@ +#!/bin/sh + +if [ -z "$1" ] ; then + echo + echo "Usage : $(basename $0) [Locale]" + echo "Examples :" + echo "$(basename $0) en_GB" + echo + exit 0 +fi + +# Create a new .ts file for a new translation in qgis +# 1. create a clean Qt .pro file for the project +# 2. run lupdate using the .pro file from step 1 +# 3. remove the .pro +# update_ts_files.sh,v 1.3 2004/07/14 18:16:24 gsherman Exp + +#first tar the qt_xx.ts files in i18n folder such that lupdate does not +#merge the qgis strings to them +QTDIR=/usr/ +echo Creating qt_ts.tar +tar -cvf i18n/qt_ts.tar i18n/qt_*.ts +rm i18n/qt_*.ts +echo Creating qmake project file +$QTDIR/bin/qmake-4.3 -project -o qgis_ts.pro +#add our new translation to the pro file +echo "Creating new translation entry for $1 in the pro file" +echo "TRANSLATIONS += i18n/qgis_${1}.ts" >> qgis_ts.pro +echo Updating translation files +$QTDIR/bin/lupdate-4.3 -verbose qgis_ts.pro +echo Removing qmake project file +rm qgis_ts.pro +echo Unpacking qt_ts.tar +tar -xvf i18n/qt_ts.tar