File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414# #
1515# ##########################################################################
1616
17+ use strict;
18+ use warnings;
19+ use Carp qw/ croak/ ;
1720use XML::Simple;
1821
22+ $SIG {__WARN__ } = sub { croak @_ ; };
23+
1924die " usage: $0 source.ts dest.cpp\n " unless @ARGV ==2 && -f $ARGV [0];
2025
2126my $xml = XMLin($ARGV [0], ForceArray => 1);
2227
2328open F, " >$ARGV [1]" ;
29+ binmode (F, " :utf8" );
2430
2531print F <<EOF ;
2632/*
4652 $message -> {comment }-> [0] =~ s / "/ \\ "/ g ;
4753 $message -> {comment }-> [0] =~ s /\n / \\ n/ g ;
4854
49- print F " ,\" $context ->{comment}->[0]\" " ;
55+ print F " ,\" $message ->{comment}->[0]\" " ;
5056 }
5157
5258 if ( exists $message -> {numerus } && $message -> {numerus } eq " yes" ) {
Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ cleanup() {
4646 trap " " EXIT
4747}
4848
49+ export QT_SELECT=5
50+
4951PATH=$QTDIR /bin:$PATH
5052
5153if type qmake-qt5 > /dev/null 2>&1 ; then
@@ -70,7 +72,7 @@ if ! type tx >/dev/null 2>&1; then
7072 exit 1
7173fi
7274
73- builddir=$2
75+ builddir=$( realpath $2 )
7476if [ -d " $builddir " ]; then
7577 textcpp=
7678 for i in $builddir /src/core/qgsexpression_texts.cpp $builddir /src/core/qgscontexthelp_texts.cpp; do
@@ -96,6 +98,10 @@ tar --remove-files -cf i18n/backup.tar $files
9698if [ $1 = push ]; then
9799 echo Pulling source from transifex...
98100 tx pull -s -l none
101+ if ! [ -f " i18n/qgis_en.ts" ]; then
102+ echo Download of source translation failed
103+ exit
104+ fi
99105elif [ $1 = pull ]; then
100106 rm i18n/qgis_* .ts
101107
@@ -134,7 +140,7 @@ echo Updating processing translations
134140perl scripts/processing2cpp.pl python/plugins/processing/processing-i18n.cpp
135141
136142echo Creating qmake project file
137- $QMAKE -project -o qgis_ts.pro -nopwd src python i18n $textcpp
143+ $QMAKE -project -o qgis_ts.pro -nopwd $PWD / src $PWD / python $PWD / i18n $textcpp
138144
139145echo Updating translations
140146$LUPDATE -locations absolute -verbose qgis_ts.pro
You can’t perform that action at this time.
0 commit comments