Skip to content

Commit 81089a1

Browse files
author
radosuav
committedOct 6, 2014
Fix translations in Processing.py
1 parent e5850f3 commit 81089a1

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed
 

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def addProvider(provider, updateList=False):
9595
Processing.updateAlgsList()
9696
except:
9797
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
98-
self.tr('Could not load provider: %s\n%s')
98+
Processing.tr('Could not load provider: %s\n%s')
9999
% (provider.getDescription(), unicode(sys.exc_info()[1])))
100100
Processing.removeProvider(provider)
101101

@@ -284,7 +284,7 @@ def runAlgorithm(algOrName, onFinish, *args):
284284
print 'Error: Wrong parameter value %s for parameter %s.' \
285285
% (value, name)
286286
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
287-
self.tr('Error in %s. Wrong parameter value %s for parameter %s.') \
287+
Processing.tr('Error in %s. Wrong parameter value %s for parameter %s.') \
288288
% (alg.name, value, name))
289289
return
290290
# fill any missing parameters with default values if allowed
@@ -293,7 +293,7 @@ def runAlgorithm(algOrName, onFinish, *args):
293293
if not param.setValue(None):
294294
print ('Error: Missing parameter value for parameter %s.' % (param.name))
295295
ProcessingLog.addToLog(ProcessingLog.LOG_ERROR,
296-
self.tr('Error in %s. Missing parameter value for parameter %s.') \
296+
Processing.tr('Error in %s. Missing parameter value for parameter %s.') \
297297
% (alg.name, param.name))
298298
return
299299
else:
@@ -347,9 +347,10 @@ def runAlgorithm(algOrName, onFinish, *args):
347347
QApplication.restoreOverrideCursor()
348348
progress.close()
349349
return alg
350-
351-
def tr(self, string, context=''):
350+
351+
@staticmethod
352+
def tr(string, context=''):
352353
if context == '':
353354
context = 'Processing'
354-
return QtCore.QCoreApplication.translate(context, string)
355+
return QCoreApplication.translate(context, string)
355356

0 commit comments

Comments
 (0)