mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
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
This commit is contained in:
parent
72f2007fc0
commit
bf87209de3
@ -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(' ', ' ')\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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user