Skip to content

Commit

Permalink
consider comments in python plugin translations
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@10651 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Apr 24, 2009
1 parent 9f919cf commit 0b1dfd0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 10 additions & 1 deletion scripts/ts2cpp.pl
Expand Up @@ -27,7 +27,16 @@
$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";
}
}

Expand Down
3 changes: 1 addition & 2 deletions scripts/update_ts_files.sh
Expand Up @@ -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
Expand Down

0 comments on commit 0b1dfd0

Please sign in to comment.