Skip to content

Commit 25b6a53

Browse files
author
jef
committed
consider comments in python plugin translations
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10651 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent ac7eb3e commit 25b6a53

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

scripts/ts2cpp.pl

+10-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,16 @@
2727
$message->{source}->[0] =~ s/"/\\"/g;
2828
$message->{source}->[0] =~ s/\n/\\n/g;
2929

30-
print F "translate( \"$context->{name}->[0]\", \"$message->{source}->[0]\");\n";
30+
print F "translate( \"$context->{name}->[0]\", \"$message->{source}->[0]\"";
31+
32+
if( exists $message->{comment} && $message->{comment}->[0] ne "") {
33+
$message->{comment}->[0] =~ s/"/\\"/g;
34+
$message->{comment}->[0] =~ s/\n/\\n/g;
35+
36+
print F ",\"$context->{comment}->[0]\"";
37+
}
38+
39+
print F ");\n";
3140
}
3241
}
3342

scripts/update_ts_files.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ echo Creating qt_ts.tar
1515
tar -cvf i18n/qt_ts.tar i18n/qt_*.ts
1616
rm i18n/qt_*.ts
1717
echo Updating python plugin translations
18-
P=$PWD
1918
for i in python/plugins/*/.; do
2019
cd $i
2120
pylupdate4 $(find . -name "*.py") -ts i18n.ts
22-
perl $P/scripts/ts2cpp.pl i18n.ts i18n.cpp
21+
perl ../../../scripts/ts2cpp.pl i18n.ts i18n.cpp
2322
rm i18n.ts
2423
cd ../../..
2524
done

0 commit comments

Comments
 (0)