@@ -91,16 +91,15 @@ def showException(type, value, tb, msg, messagebar=False):
91
91
# Grab the first message bar for now
92
92
bar = widgets [0 ]
93
93
94
-
95
94
item = bar .currentItem ()
96
95
if item and item .property ("Error" ) == msg :
97
96
# Return of we already have a message with the same error message
98
97
return
99
98
100
- widget = bar .createMessage (title , msg + " See message log (Python Error) for more details." )
99
+ widget = bar .createMessage (title , msg + " " + QCoreApplication . translate ( "Python" , " See message log (Python Error) for more details.") )
101
100
widget .setProperty ("Error" , msg )
102
- stackbutton = QPushButton (" Stack trace" , pressed = functools .partial (open_stack_dialog , type , value , tb , msg ))
103
- button = QPushButton (" View message log" , pressed = show_message_log )
101
+ stackbutton = QPushButton (QCoreApplication . translate ( "Python" , " Stack trace") , pressed = functools .partial (open_stack_dialog , type , value , tb , msg ))
102
+ button = QPushButton (QCoreApplication . translate ( "Python" , " View message log") , pressed = show_message_log )
104
103
widget .layout ().addWidget (stackbutton )
105
104
widget .layout ().addWidget (button )
106
105
bar .pushWidget (widget , QgsMessageBar .WARNING )
@@ -121,7 +120,7 @@ def open_stack_dialog(type, value, tb, msg, pop_error=True):
121
120
msg = QCoreApplication .translate ('Python' , 'An error has occured while executing Python code:' )
122
121
123
122
# TODO Move this to a template HTML file
124
- txt = '''<font color="red"><b>{msg}</b></font>
123
+ txt = u '''<font color="red"><b>{msg}</b></font>
125
124
<br>
126
125
<h3>{main_error}</h3>
127
126
<pre>
@@ -158,7 +157,7 @@ def open_stack_dialog(type, value, tb, msg, pop_error=True):
158
157
qgisrelease = QGis .QGIS_RELEASE_NAME ,
159
158
devversion = QGis .QGIS_DEV_VERSION ,
160
159
pypath_label = pypath_label ,
161
- pypath = "" .join ("<li>{}</li>" .format (path ) for path in sys .path ))
160
+ pypath = u "" .join (u "<li>{}</li>" .format (path ) for path in sys .path ))
162
161
163
162
txt = txt .replace (' ' , ' ' ) # preserve whitespaces for nicer output
164
163
0 commit comments