Skip to content
Permalink
Browse files
Escape quotes in translations of strings passed into python code
(was a problem in french translation)


git-svn-id: http://svn.osgeo.org/qgis/trunk@9633 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Nov 13, 2008
1 parent 72f2007 commit bf87209de3fbd7997420a2e310dcb4cdbb72b021
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/python/qgspythonutilsimpl.cpp
@@ -87,17 +87,17 @@ void QgsPythonUtilsImpl::initPython( QgisInterface* interface )
runString(
"def qgis_except_hook_msg(type, value, tb, msg):\n"
" lst = traceback.format_exception(type, value, tb)\n"
" if msg == None: msg = '" + QObject::tr( "An error has occured while executing Python code:" ) + "'\n"
" if msg == None: msg = '" + QObject::tr( "An error has occured while executing Python code:" ).replace("'", "\\'") + "'\n"
" txt = '<font color=\"red\">'+msg+'</font><br><br>'\n"
" for s in lst:\n"
" txt += s\n"
" txt += '<br>" + QObject::tr( "Python version:" ) + "<br>' + sys.version + '<br><br>'\n"
" txt += '" + QObject::tr( "Python path:" ) + "' + str(sys.path)\n"
" txt += '<br>" + QObject::tr( "Python version:" ).replace("'", "\\'") + "<br>' + sys.version + '<br><br>'\n"
" txt += '" + QObject::tr( "Python path:" ).replace("'", "\\'") + "' + str(sys.path)\n"
" txt = txt.replace('\\n', '<br>')\n"
" txt = txt.replace(' ', '&nbsp; ')\n" // preserve whitespaces for nicer output
" \n"
" msg = QgsMessageOutput.createMessageOutput()\n"
" msg.setTitle('" + QObject::tr( "Python error" ) + "')\n"
" msg.setTitle('" + QObject::tr( "Python error" ).replace("'", "\\'") + "')\n"
" msg.setMessage(txt, QgsMessageOutput.MessageHtml)\n"
" msg.showMessage()\n" );
runString(

0 comments on commit bf87209

Please sign in to comment.