Skip to content
Permalink
Browse files

Trying to make Providers labels translatable

in DB Manager tree
  • Loading branch information
DelazJ committed May 1, 2018
1 parent f1aaa14 commit 394aaba060fe0f1b3efe5eccaa8a53da87049968
@@ -24,7 +24,7 @@
# this will disable the dbplugin if the connector raise an ImportError
from .connector import GPKGDBConnector

from qgis.PyQt.QtCore import Qt, QFileInfo
from qgis.PyQt.QtCore import Qt, QFileInfo, QCoreApplication
from qgis.PyQt.QtGui import QIcon
from qgis.PyQt.QtWidgets import QApplication, QAction, QFileDialog
from qgis.core import Qgis, QgsDataSourceUri, QgsSettings
@@ -53,7 +53,7 @@ def typeName(self):

@classmethod
def typeNameString(self):
return 'GeoPackage'
return QCoreApplication.translate('db_manager', 'GeoPackage')

@classmethod
def providerName(self):
@@ -28,7 +28,7 @@
# this will disable the dbplugin if the connector raise an ImportError
from .connector import OracleDBConnector

from qgis.PyQt.QtCore import Qt
from qgis.PyQt.QtCore import Qt, QCoreApplication
from qgis.PyQt.QtGui import QIcon, QKeySequence
from qgis.PyQt.QtWidgets import QAction, QApplication, QMessageBox

@@ -59,7 +59,7 @@ def typeName(self):

@classmethod
def typeNameString(self):
return 'Oracle Spatial'
return QCoreApplication.translate('db_manager', 'Oracle Spatial')

@classmethod
def providerName(self):
@@ -26,7 +26,7 @@
# this will disable the dbplugin if the connector raise an ImportError
from .connector import PostGisDBConnector

from qgis.PyQt.QtCore import Qt, QRegExp
from qgis.PyQt.QtCore import Qt, QRegExp, QCoreApplication
from qgis.PyQt.QtGui import QIcon
from qgis.PyQt.QtWidgets import QAction, QApplication, QMessageBox
from qgis.core import Qgis, QgsSettings
@@ -56,7 +56,7 @@ def typeName(self):

@classmethod
def typeNameString(self):
return 'PostGIS'
return QCoreApplication.translate('db_manager', 'PostGIS')

@classmethod
def providerName(self):
@@ -24,7 +24,7 @@
# this will disable the dbplugin if the connector raise an ImportError
from .connector import SpatiaLiteDBConnector

from qgis.PyQt.QtCore import Qt, QFileInfo
from qgis.PyQt.QtCore import Qt, QFileInfo, QCoreApplication
from qgis.PyQt.QtGui import QIcon
from qgis.PyQt.QtWidgets import QApplication, QAction, QFileDialog
from qgis.core import Qgis, QgsDataSourceUri, QgsSettings
@@ -52,7 +52,7 @@ def typeName(self):

@classmethod
def typeNameString(self):
return 'SpatiaLite'
return QCoreApplication.translate('db_manager', 'SpatiaLite')

@classmethod
def providerName(self):
@@ -23,7 +23,7 @@
from .connector import VLayerConnector

from qgis.PyQt.QtGui import QIcon
from qgis.core import QgsVectorLayer, QgsProject, QgsVirtualLayerDefinition
from qgis.core import QgsVectorLayer, QgsProject, QgsVirtualLayerDefinition, QCoreApplication

from ..plugin import DBPlugin, Database, Table, VectorTable, TableField

@@ -46,7 +46,7 @@ def typeName(self):

@classmethod
def typeNameString(self):
return 'Virtual Layers'
return QCoreApplication.translate('db_manager', 'Virtual Layers')

@classmethod
def providerName(self):
@@ -58,7 +58,7 @@ def connectionSettingsKey(self):

@classmethod
def connections(self):
return [VLayerDBPlugin('QGIS layers')]
return [VLayerDBPlugin(QCoreApplication.translate('db_manager', 'QGIS layers'))]

def databasesFactory(self, connection, uri):
return FakeDatabase(connection, uri)

0 comments on commit 394aaba

Please sign in to comment.
You can’t perform that action at this time.