Skip to content
Permalink
Browse files

update translation scripts

  • Loading branch information
jef-n committed Jun 9, 2017
1 parent d4acdac commit 5ff6b14fe93370945af2250669783c66d45300db
Showing with 15 additions and 3 deletions.
  1. +7 −1 scripts/ts2cpp.pl
  2. +8 −2 scripts/update_ts.sh
@@ -14,13 +14,19 @@
# #
###########################################################################

use strict;
use warnings;
use Carp qw/croak/;
use XML::Simple;

$SIG{__WARN__} = sub { croak @_; };

die "usage: $0 source.ts dest.cpp\n" unless @ARGV==2 && -f $ARGV[0];

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

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

print F <<EOF;
/*
@@ -46,7 +52,7 @@
$message->{comment}->[0] =~ s/"/\\"/g;
$message->{comment}->[0] =~ s/\n/\\n/g;

print F ",\"$context->{comment}->[0]\"";
print F ",\"$message->{comment}->[0]\"";
}

if( exists $message->{numerus} && $message->{numerus} eq "yes" ) {
@@ -46,6 +46,8 @@ cleanup() {
trap "" EXIT
}

export QT_SELECT=5

PATH=$QTDIR/bin:$PATH

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

builddir=$2
builddir=$(realpath $2)
if [ -d "$builddir" ]; then
textcpp=
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
if [ $1 = push ]; then
echo Pulling source from transifex...
tx pull -s -l none
if ! [ -f "i18n/qgis_en.ts" ]; then
echo Download of source translation failed
exit
fi
elif [ $1 = pull ]; then
rm i18n/qgis_*.ts

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

echo Creating qmake project file
$QMAKE -project -o qgis_ts.pro -nopwd src python i18n $textcpp
$QMAKE -project -o qgis_ts.pro -nopwd $PWD/src $PWD/python $PWD/i18n $textcpp

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

0 comments on commit 5ff6b14

Please sign in to comment.
You can’t perform that action at this time.