consider comments in python plugin translations

git-svn-id: http://svn.osgeo.org/qgis/trunk@10651 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
jef 2009-04-24 20:20:03 +00:00
parent 9f919cfda7
commit 0b1dfd0b8c
2 changed files with 11 additions and 3 deletions

View File

@ -27,7 +27,16 @@ foreach my $context ( @{ $xml->{context} } ) {
$message->{source}->[0] =~ s/"/\\"/g;
$message->{source}->[0] =~ s/\n/\\n/g;
print F "translate( \"$context->{name}->[0]\", \"$message->{source}->[0]\");\n";
print F "translate( \"$context->{name}->[0]\", \"$message->{source}->[0]\"";
if( exists $message->{comment} && $message->{comment}->[0] ne "") {
$message->{comment}->[0] =~ s/"/\\"/g;
$message->{comment}->[0] =~ s/\n/\\n/g;
print F ",\"$context->{comment}->[0]\"";
}
print F ");\n";
}
}

View File

@ -15,11 +15,10 @@ echo Creating qt_ts.tar
tar -cvf i18n/qt_ts.tar i18n/qt_*.ts
rm i18n/qt_*.ts
echo Updating python plugin translations
P=$PWD
for i in python/plugins/*/.; do
cd $i
pylupdate4 $(find . -name "*.py") -ts i18n.ts
perl $P/scripts/ts2cpp.pl i18n.ts i18n.cpp
perl ../../../scripts/ts2cpp.pl i18n.ts i18n.cpp
rm i18n.ts
cd ../../..
done