Skip to content
Permalink
Browse files

dbmanager: add i18n

  • Loading branch information
jef-n committed Jun 9, 2013
1 parent d6fa765 commit f0c605e0fa83b52a4502d3b2c3cb5cfe66ae6d79
Showing with 255 additions and 259 deletions.
  1. +1 −1 python/plugins/db_manager/CREDITS
  2. +1 −1 python/plugins/db_manager/README
  3. +1 −1 python/plugins/db_manager/__init__.py
  4. +1 −1 python/plugins/db_manager/completer.py
  5. +20 −21 python/plugins/db_manager/db_manager.py
  6. +6 −7 python/plugins/db_manager/db_manager_plugin.py
  7. +5 −5 python/plugins/db_manager/db_model.py
  8. +2 −2 python/plugins/db_manager/db_plugins/__init__.py
  9. +1 −1 python/plugins/db_manager/db_plugins/connector.py
  10. +3 −3 python/plugins/db_manager/db_plugins/data_model.py
  11. +1 −1 python/plugins/db_manager/db_plugins/html_elems.py
  12. +54 −54 python/plugins/db_manager/db_plugins/info_model.py
  13. +44 −44 python/plugins/db_manager/db_plugins/plugin.py
  14. +1 −1 python/plugins/db_manager/db_plugins/postgis/connector.py
  15. +1 −1 python/plugins/db_manager/db_plugins/postgis/data_model.py
  16. +28 −28 python/plugins/db_manager/db_plugins/postgis/info_model.py
  17. +10 −8 python/plugins/db_manager/db_plugins/postgis/plugin.py
  18. +1 −1 python/plugins/db_manager/db_plugins/postgis/plugins/__init__.py
  19. +2 −2 python/plugins/db_manager/db_plugins/postgis/plugins/versioning/__init__.py
  20. +2 −2 python/plugins/db_manager/db_plugins/spatialite/connector.py
  21. +1 −1 python/plugins/db_manager/db_plugins/spatialite/data_model.py
  22. +3 −3 python/plugins/db_manager/db_plugins/spatialite/info_model.py
  23. +4 −4 python/plugins/db_manager/db_plugins/spatialite/plugin.py
  24. +5 −5 python/plugins/db_manager/db_tree.py
  25. +2 −3 python/plugins/db_manager/dlg_add_geometry_column.py
  26. +1 −1 python/plugins/db_manager/dlg_create_constraint.py
  27. +2 −2 python/plugins/db_manager/dlg_create_index.py
  28. +12 −12 python/plugins/db_manager/dlg_create_table.py
  29. +1 −1 python/plugins/db_manager/dlg_db_error.py
  30. +7 −7 python/plugins/db_manager/dlg_export_vector.py
  31. +2 −2 python/plugins/db_manager/dlg_field_properties.py
  32. +11 −13 python/plugins/db_manager/dlg_import_vector.py
  33. +3 −3 python/plugins/db_manager/dlg_sql_window.py
  34. +9 −9 python/plugins/db_manager/dlg_table_properties.py
  35. +1 −1 python/plugins/db_manager/highlighter.py
  36. +2 −3 python/plugins/db_manager/info_viewer.py
  37. +2 −2 python/plugins/db_manager/layer_preview.py
  38. +2 −2 python/plugins/db_manager/table_viewer.py
@@ -1,6 +1,6 @@
CREDITS: 2011/10/13

DB Manager plugin for QuantumGIS
DB Manager plugin for QGIS

Author and maintainer:
Giuseppe Sucameli <brush.tyler@gmail.com>
@@ -1,6 +1,6 @@
DB Manager * Copyright (c) 2011 Giuseppe Sucameli

DB Manager is a database manager plugin for QuantumGIS.
DB Manager is a database manager plugin for QGIS.
It allows to you to show the DBs contents and run query on them.

In this moment DB Manager supports the following DBMS backends:
@@ -3,7 +3,7 @@
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QuantumGIS
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@gmail.com
@@ -3,7 +3,7 @@
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QuantumGIS
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@gmail.com
@@ -3,7 +3,7 @@
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QuantumGIS
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@gmail.com
@@ -45,8 +45,8 @@ def __init__(self, iface, parent=None):

# restore the window state
settings = QSettings()
self.restoreGeometry( settings.value("/DB_Manager/mainWindow/geometry") )
self.restoreState( settings.value("/DB_Manager/mainWindow/windowState") )
self.restoreGeometry( settings.value("/DB_Manager/mainWindow/geometry", QByteArray(), type=QByteArray ) )
self.restoreState( settings.value("/DB_Manager/mainWindow/windowState", QByteArray(), type=QByteArray ) )

self.connect(self.tabs, SIGNAL("currentChanged(int)"), self.tabChanged)
self.connect(self.tree, SIGNAL("selectedItemChanged"), self.itemChanged)
@@ -147,7 +147,7 @@ def refreshActionSlot(self):
def importActionSlot(self):
db = self.tree.currentDatabase()
if db is None:
QMessageBox.information(self, "Sorry", "No database selected or you are not connected to it.")
QMessageBox.information(self, self.tr("Sorry"), self.tr("No database selected or you are not connected to it."))
return

outUri = db.uri()
@@ -162,7 +162,7 @@ def importActionSlot(self):
def exportActionSlot(self):
table = self.tree.currentTable()
if table is None:
QMessageBox.information(self, "Sorry", "Select the table you want export to file.")
QMessageBox.information(self, self.tr("Sorry"), self.tr("Select the table you want export to file."))
return

inLayer = table.toMapLayer()
@@ -176,7 +176,7 @@ def exportActionSlot(self):
def runSqlWindow(self):
db = self.tree.currentDatabase()
if db == None:
QMessageBox.information(self, "Sorry", "No database selected or you are not connected to it.")
QMessageBox.information(self, self.tr("Sorry"), self.tr("No database selected or you are not connected to it."))
return

from dlg_sql_window import DlgSqlWindow
@@ -333,18 +333,18 @@ def unregisterAllActions(self):
del self._registeredDbActions

def setupUi(self):
self.setWindowTitle("DB Manager")
self.setWindowTitle(self.tr("DB Manager"))
self.setWindowIcon(QIcon(":/db_manager/icon"))
self.resize(QSize(700,500).expandedTo(self.minimumSizeHint()))

# create central tab widget
self.tabs = QTabWidget()
self.info = InfoViewer(self)
self.tabs.addTab(self.info, "Info")
self.tabs.addTab(self.info, self.tr("Info"))
self.table = TableViewer(self)
self.tabs.addTab(self.table, "Table")
self.tabs.addTab(self.table, self.tr("Table"))
self.preview = LayerPreview(self)
self.tabs.addTab(self.preview, "Preview")
self.tabs.addTab(self.preview, self.tr("Preview"))
self.setCentralWidget(self.tabs)

# create database tree
@@ -361,13 +361,13 @@ def setupUi(self):

# create menus
self.menuBar = QMenuBar(self)
self.menuDb = QMenu("&Database", self)
self.menuDb = QMenu(self.tr("&Database"), self)
actionMenuDb = self.menuBar.addMenu(self.menuDb)
self.menuSchema = QMenu("&Schema", self)
self.menuSchema = QMenu(self.tr("&Schema"), self)
actionMenuSchema = self.menuBar.addMenu(self.menuSchema)
self.menuTable = QMenu("&Table", self)
self.menuTable = QMenu(self.tr("&Table"), self)
actionMenuTable = self.menuBar.addMenu(self.menuTable)
self.menuHelp = None#QMenu("&Help", self)
self.menuHelp = None # QMenu(self.tr("&Help"), self)
#actionMenuHelp = self.menuBar.addMenu(self.menuHelp)

self.setMenuBar(self.menuBar)
@@ -382,21 +382,21 @@ def setupUi(self):

# menu DATABASE
sep = self.menuDb.addSeparator(); sep.setObjectName("DB_Manager_DbMenu_placeholder"); sep.setVisible(False)
self.actionRefresh = self.menuDb.addAction( QIcon(":/db_manager/actions/refresh"), "&Refresh", self.refreshActionSlot, QKeySequence("F5") )
self.actionSqlWindow = self.menuDb.addAction( QIcon(":/db_manager/actions/sql_window"), "&SQL window", self.runSqlWindow, QKeySequence("F2") )
self.actionRefresh = self.menuDb.addAction( QIcon(":/db_manager/actions/refresh"), self.tr("&Refresh"), self.refreshActionSlot, QKeySequence("F5") )
self.actionSqlWindow = self.menuDb.addAction( QIcon(":/db_manager/actions/sql_window"), self.tr("&SQL window"), self.runSqlWindow, QKeySequence("F2") )
self.menuDb.addSeparator()
self.actionClose = self.menuDb.addAction( QIcon(), "&Exit", self.close, QKeySequence("CTRL+Q") )
self.actionClose = self.menuDb.addAction( QIcon(), self.tr("&Exit"), self.close, QKeySequence("CTRL+Q") )

# menu SCHEMA
sep = self.menuSchema.addSeparator(); sep.setObjectName("DB_Manager_SchemaMenu_placeholder"); sep.setVisible(False)
actionMenuSchema.setVisible(False)

# menu TABLE
sep = self.menuTable.addSeparator(); sep.setObjectName("DB_Manager_TableMenu_placeholder"); sep.setVisible(False)
self.actionImport = self.menuTable.addAction( QIcon(":/db_manager/actions/import"), "&Import layer/file", self.importActionSlot )
self.actionExport = self.menuTable.addAction( QIcon(":/db_manager/actions/export"), "&Export to file", self.exportActionSlot )
self.actionImport = self.menuTable.addAction( QIcon(":/db_manager/actions/import"), self.tr("&Import layer/file"), self.importActionSlot )
self.actionExport = self.menuTable.addAction( QIcon(":/db_manager/actions/export"), self.tr("&Export to file"), self.exportActionSlot )
self.menuTable.addSeparator()
#self.actionShowSystemTables = self.menuTable.addAction("Show system tables/views", self.showSystemTables)
#self.actionShowSystemTables = self.menuTable.addAction(self.tr("Show system tables/views"), self.showSystemTables)
#self.actionShowSystemTables.setCheckable(True)
#self.actionShowSystemTables.setChecked(True)
actionMenuTable.setVisible(False)
@@ -406,4 +406,3 @@ def setupUi(self):
self.toolBar.addAction( self.actionSqlWindow )
self.toolBar.addAction( self.actionImport )
self.toolBar.addAction( self.actionExport )

@@ -3,7 +3,7 @@
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QuantumGIS
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@gmail.com
@@ -34,24 +34,24 @@ def __init__(self, iface):
self.dlg = None

def initGui(self):
self.action = QAction( QIcon(":/db_manager/icon"), u"DB Manager", self.iface.mainWindow() )
self.action = QAction( QIcon(":/db_manager/icon"), QApplication.translate("DBManagerPlugin","DB Manager"), self.iface.mainWindow() )
QObject.connect( self.action, SIGNAL( "triggered()" ), self.run )
# Add toolbar button and menu item
if hasattr( self.iface, 'addDatabaseToolBarIcon' ):
self.iface.addDatabaseToolBarIcon(self.action)
else:
self.iface.addToolBarIcon(self.action)
if hasattr( self.iface, 'addPluginToDatabaseMenu' ):
self.iface.addPluginToDatabaseMenu( u"DB Manager", self.action )
self.iface.addPluginToDatabaseMenu( QApplication.translate("DBManagerPlugin","DB Manager"), self.action )
else:
self.iface.addPluginToMenu( u"DB Manager", self.action )
self.iface.addPluginToMenu( QApplication.translate("DBManagerPlugin","DB Manager"), self.action )

def unload(self):
# Remove the plugin menu item and icon
if hasattr( self.iface, 'removePluginDatabaseMenu' ):
self.iface.removePluginDatabaseMenu( u"DB Manager", self.action )
self.iface.removePluginDatabaseMenu( QApplication.translate("DBManagerPlugin","DB Manager"), self.action )
else:
self.iface.removePluginMenu( u"DB Manager", self.action )
self.iface.removePluginMenu( QApplication.translate("DBManagerPlugin","DB Manager"), self.action )
if hasattr( self.iface, 'removeDatabaseToolBarIcon' ):
self.iface.removeDatabaseToolBarIcon(self.action)
else:
@@ -72,4 +72,3 @@ def run(self):

def onDestroyed(self, obj):
self.dlg = None

@@ -3,7 +3,7 @@
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QuantumGIS
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@gmail.com
@@ -152,7 +152,7 @@ def populate(self):
return False

except BaseError, e:
QMessageBox.warning( None, u"Unable to connect", unicode(e) )
QMessageBox.warning( None, self.tr("Unable to connect"), unicode(e) )
return False

database = connection.database()
@@ -267,7 +267,7 @@ class DBModel(QAbstractItemModel):
def __init__(self, parent=None):
QAbstractItemModel.__init__(self, parent)
self.treeView = parent
self.header = ['Databases']
self.header = [self.tr('Databases')]

self.isImportVectorAvail = hasattr(qgis.core, 'QgsVectorLayerImport')
if self.isImportVectorAvail:
@@ -530,7 +530,7 @@ def dropMimeData(self, data, action, row, column, parent):
parts = mimeUri.split(":", 3)
if len(parts) != 4:
# invalid qgis mime uri
QMessageBox.warning(None, "Invalid MIME uri", "The dropped object is not a valid QGis layer")
QMessageBox.warning(None, self.tr("Invalid MIME uri"), self.tr("The dropped object is not a valid QGis layer"))
continue

layerType, providerKey, layerName, uriString = parts
@@ -553,7 +553,7 @@ def importLayer(self, layerType, providerKey, layerName, uriString, parent):

if not inLayer.isValid():
# invalid layer
QMessageBox.warning(None, "Invalid layer", u"QGis was unable to load the layer %s" % inLayer.name())
QMessageBox.warning(None, self.tr("Invalid layer"), self.tr("QGis was unable to load the layer %s") % inLayer.name)
return False

# retrieve information about the new table's db and schema
@@ -3,7 +3,7 @@
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QuantumGIS
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@gmail.com
@@ -25,7 +25,7 @@

class NotSupportedDbType(Exception):
def __init__(self, dbtype):
self.msg = u"%s is not supported yet" % dbtype
self.msg = self.tr("%s is not supported yet") % dbtype
Exception(self, self.msg)

def __str__(self):
@@ -3,7 +3,7 @@
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QuantumGIS
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@gmail.com
@@ -3,7 +3,7 @@
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QuantumGIS
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@gmail.com
@@ -243,7 +243,7 @@ def getFields(self):

class TableConstraintsModel(SimpleTableModel):
def __init__(self, parent, editable=False):
SimpleTableModel.__init__(self, ['Name', 'Type', 'Column(s)'], editable, parent)
SimpleTableModel.__init__(self, [QApplication.translate("DBManagerPlugin", 'Name'), QApplication.translate("DBManagerPlugin", 'Type'), QApplication.translate("DBManagerPlugin", 'Column(s)')], editable, parent)

def append(self, constr):
field_names = map( lambda (k,v): unicode(v.name), constr.fields().iteritems() )
@@ -275,7 +275,7 @@ def getConstraints(self):

class TableIndexesModel(SimpleTableModel):
def __init__(self, parent, editable=False):
SimpleTableModel.__init__(self, ['Name', 'Column(s)'], editable, parent)
SimpleTableModel.__init__(self, [QApplication.translate("DBManagerPlugin", 'Name'), QApplication.translate("DBManagerPlugin", 'Column(s)')], editable, parent)

def append(self, idx):
field_names = map( lambda (k,v): unicode(v.name), idx.fields().iteritems() )
@@ -3,7 +3,7 @@
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QuantumGIS
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@gmail.com

0 comments on commit f0c605e

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