Skip to content

Commit 394aaba

Browse files
committed
Trying to make Providers labels translatable
in DB Manager tree
1 parent f1aaa14 commit 394aaba

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

python/plugins/db_manager/db_plugins/gpkg/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# this will disable the dbplugin if the connector raise an ImportError
2525
from .connector import GPKGDBConnector
2626

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

5454
@classmethod
5555
def typeNameString(self):
56-
return 'GeoPackage'
56+
return QCoreApplication.translate('db_manager', 'GeoPackage')
5757

5858
@classmethod
5959
def providerName(self):

python/plugins/db_manager/db_plugins/oracle/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
# this will disable the dbplugin if the connector raise an ImportError
2929
from .connector import OracleDBConnector
3030

31-
from qgis.PyQt.QtCore import Qt
31+
from qgis.PyQt.QtCore import Qt, QCoreApplication
3232
from qgis.PyQt.QtGui import QIcon, QKeySequence
3333
from qgis.PyQt.QtWidgets import QAction, QApplication, QMessageBox
3434

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

6060
@classmethod
6161
def typeNameString(self):
62-
return 'Oracle Spatial'
62+
return QCoreApplication.translate('db_manager', 'Oracle Spatial')
6363

6464
@classmethod
6565
def providerName(self):

python/plugins/db_manager/db_plugins/postgis/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# this will disable the dbplugin if the connector raise an ImportError
2727
from .connector import PostGisDBConnector
2828

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

5757
@classmethod
5858
def typeNameString(self):
59-
return 'PostGIS'
59+
return QCoreApplication.translate('db_manager', 'PostGIS')
6060

6161
@classmethod
6262
def providerName(self):

python/plugins/db_manager/db_plugins/spatialite/plugin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# this will disable the dbplugin if the connector raise an ImportError
2525
from .connector import SpatiaLiteDBConnector
2626

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

5353
@classmethod
5454
def typeNameString(self):
55-
return 'SpatiaLite'
55+
return QCoreApplication.translate('db_manager', 'SpatiaLite')
5656

5757
@classmethod
5858
def providerName(self):

python/plugins/db_manager/db_plugins/vlayers/plugin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
from .connector import VLayerConnector
2424

2525
from qgis.PyQt.QtGui import QIcon
26-
from qgis.core import QgsVectorLayer, QgsProject, QgsVirtualLayerDefinition
26+
from qgis.core import QgsVectorLayer, QgsProject, QgsVirtualLayerDefinition, QCoreApplication
2727

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

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

4747
@classmethod
4848
def typeNameString(self):
49-
return 'Virtual Layers'
49+
return QCoreApplication.translate('db_manager', 'Virtual Layers')
5050

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

5959
@classmethod
6060
def connections(self):
61-
return [VLayerDBPlugin('QGIS layers')]
61+
return [VLayerDBPlugin(QCoreApplication.translate('db_manager', 'QGIS layers'))]
6262

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

0 commit comments

Comments
 (0)