Skip to content
Permalink
Browse files
Move tr out of AlgorithmProvider to subclasses
  • Loading branch information
nyalldawson committed Apr 7, 2017
1 parent 9a97a87 commit 3739c3aa51822d1a724ca542ffc2d3e31e530dba
@@ -27,6 +27,7 @@

import os

from qgis.PyQt.QtCore import QCoreApplication
from qgis.core import QgsApplication
from processing.core.AlgorithmProvider import AlgorithmProvider
from processing.core.ProcessingConfig import ProcessingConfig, Setting
@@ -146,3 +147,8 @@ def loadAlgorithms(self):

def supportedOutputRasterLayerExtensions(self):
return GdalUtils.getSupportedRasterExtensions()

def tr(self, string, context=''):
if context == '':
context = 'GdalAlgorithmProvider'
return QCoreApplication.translate(context, string)
@@ -27,6 +27,7 @@
__revision__ = '$Format:%H$'

import os
from qgis.PyQt.QtCore import QCoreApplication
from qgis.core import QgsApplication
from processing.core.ProcessingConfig import ProcessingConfig, Setting
from processing.core.AlgorithmProvider import AlgorithmProvider
@@ -119,3 +120,8 @@ def supportedOutputVectorLayerExtensions(self):

def canBeActivated(self):
return not bool(Grass7Utils.checkGrass7IsInstalled())

def tr(self, string, context=''):
if context == '':
context = 'Grass7AlgorithmProvider'
return QCoreApplication.translate(context, string)
@@ -28,6 +28,7 @@

import os

from qgis.PyQt.QtCore import QCoreApplication
from qgis.core import QgsApplication
from processing.core.ProcessingConfig import ProcessingConfig, Setting
from processing.core.ProcessingLog import ProcessingLog
@@ -128,3 +129,8 @@ def loadFromFolder(self, folder):
ProcessingLog.LOG_ERROR,
self.tr('Could not load R script: {0}\n{1}').format(descriptionFile, str(e)))
return

def tr(self, string, context=''):
if context == '':
context = 'RAlgorithmProvider'
return QCoreApplication.translate(context, string)
@@ -28,6 +28,7 @@

import os
from qgis.PyQt.QtGui import QIcon
from qgis.PyQt.QtCore import QCoreApplication
from processing.core.AlgorithmProvider import AlgorithmProvider
from processing.core.ProcessingConfig import ProcessingConfig, Setting
from processing.core.ProcessingLog import ProcessingLog
@@ -123,3 +124,8 @@ def getSupportedOutputTableLayerExtensions(self):

def icon(self):
return QIcon(os.path.join(pluginPath, 'images', 'saga.png'))

def tr(self, string, context=''):
if context == '':
context = 'SagaAlgorithmProvider'
return QCoreApplication.translate(context, string)
@@ -25,7 +25,6 @@

__revision__ = '$Format:%H$'

from qgis.PyQt.QtCore import QCoreApplication
from qgis.core import (QgsProcessingProvider)
from processing.core.ProcessingConfig import Setting, ProcessingConfig

@@ -72,8 +71,3 @@ def unload(self):
"""
name = 'ACTIVATE_' + self.id().upper().replace(' ', '_')
ProcessingConfig.removeSetting(name)

def tr(self, string, context=''):
if context == '':
context = self.__class__.__name__
return QCoreApplication.translate(context, string)

0 comments on commit 3739c3a

Please sign in to comment.