Skip to content

Commit bcd3d92

Browse files
committedFeb 18, 2016
Always translate Processing debug messages tab title
Fix #14287 (Redmine)
1 parent 3e550e2 commit bcd3d92

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed
 

‎python/plugins/processing/core/ProcessingLog.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def addToLog(msgtype, msg):
8383
msgtypes = {ProcessingLog.LOG_ERROR: QgsMessageLog.CRITICAL,
8484
ProcessingLog.LOG_INFO: QgsMessageLog.INFO,
8585
ProcessingLog.LOG_WARNING: QgsMessageLog.WARNING, }
86-
QgsMessageLog.logMessage(msg, "Processing", msgtypes[msgtype])
86+
QgsMessageLog.logMessage(msg, ProcessingLog.tr("Processing"), msgtypes[msgtype])
8787
except:
8888
pass
8989

@@ -137,6 +137,12 @@ def saveLog(fileName):
137137
for entry in v:
138138
f.write('%s|%s|%s\n' % (k, entry.date, entry.text))
139139

140+
@staticmethod
141+
def tr(string, context=''):
142+
if context == '':
143+
context = 'ProcessingLog'
144+
return QCoreApplication.translate(context, string)
145+
140146

141147
class LogEntry:
142148

‎python/plugins/processing/gui/GetScriptsAndModels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def popupError(self, error=None, url=None):
152152
widget = iface.messageBar().createMessage(self.tr('Connection problem', disambiguation),
153153
self.tr('Could not connect to scripts/models repository', disambiguation))
154154
if error and url:
155-
QgsMessageLog.logMessage(self.tr(u"Network error code: {} on URL: {}").format(error, url), u"Processing", QgsMessageLog.CRITICAL)
155+
QgsMessageLog.logMessage(self.tr(u"Network error code: {} on URL: {}").format(error, url), self.tr(u"Processing"), QgsMessageLog.CRITICAL)
156156
button = QPushButton(QCoreApplication.translate("Python", "View message log"), pressed=show_message_log)
157157
widget.layout().addWidget(button)
158158

0 commit comments

Comments
 (0)
Please sign in to comment.