Skip to content

Commit 5ff6b14

Browse files
committed
update translation scripts
1 parent d4acdac commit 5ff6b14

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

scripts/ts2cpp.pl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,19 @@
1414
# #
1515
###########################################################################
1616

17+
use strict;
18+
use warnings;
19+
use Carp qw/croak/;
1720
use XML::Simple;
1821

22+
$SIG{__WARN__} = sub { croak @_; };
23+
1924
die "usage: $0 source.ts dest.cpp\n" unless @ARGV==2 && -f $ARGV[0];
2025

2126
my $xml = XMLin($ARGV[0], ForceArray=>1);
2227

2328
open F, ">$ARGV[1]";
29+
binmode(F, ":utf8");
2430

2531
print F <<EOF;
2632
/*
@@ -46,7 +52,7 @@
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" ) {

scripts/update_ts.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ cleanup() {
4646
trap "" EXIT
4747
}
4848

49+
export QT_SELECT=5
50+
4951
PATH=$QTDIR/bin:$PATH
5052

5153
if type qmake-qt5 >/dev/null 2>&1; then
@@ -70,7 +72,7 @@ if ! type tx >/dev/null 2>&1; then
7072
exit 1
7173
fi
7274

73-
builddir=$2
75+
builddir=$(realpath $2)
7476
if [ -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
9698
if [ $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
99105
elif [ $1 = pull ]; then
100106
rm i18n/qgis_*.ts
101107

@@ -134,7 +140,7 @@ echo Updating processing translations
134140
perl scripts/processing2cpp.pl python/plugins/processing/processing-i18n.cpp
135141

136142
echo 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

139145
echo Updating translations
140146
$LUPDATE -locations absolute -verbose qgis_ts.pro

0 commit comments

Comments
 (0)