Skip to content
Permalink
Browse files
translation string fixes and cleanups
  • Loading branch information
jef-n committed Feb 15, 2018
1 parent fa815f0 commit 6dfedc3
Show file tree
Hide file tree
Showing 27 changed files with 178 additions and 171 deletions.
@@ -171,7 +171,7 @@ def __init__(self, parent=None):
# ------------------Toolbar Editor-------------------------------------

# Action for Open File
openFileBt = QCoreApplication.translate("PythonConsole", "Open Script...")
openFileBt = QCoreApplication.translate("PythonConsole", "Open Script")
self.openFileButton = QAction(self)
self.openFileButton.setCheckable(False)
self.openFileButton.setEnabled(True)
@@ -201,7 +201,7 @@ def __init__(self, parent=None):
self.saveFileButton.setToolTip(saveFileBt)
self.saveFileButton.setText(saveFileBt)
# Action for Save File As
saveAsFileBt = QCoreApplication.translate("PythonConsole", "Save As...")
saveAsFileBt = QCoreApplication.translate("PythonConsole", "Save As")
self.saveAsFileButton = QAction(self)
self.saveAsFileButton.setCheckable(False)
self.saveAsFileButton.setEnabled(True)
@@ -271,7 +271,7 @@ def __init__(self, parent=None):
self.uncommentEditorButton.setToolTip(uncommentEditorBt)
self.uncommentEditorButton.setText(uncommentEditorBt)
# Action for Object browser
objList = QCoreApplication.translate("PythonConsole", "Object Inspector...")
objList = QCoreApplication.translate("PythonConsole", "Object Inspector")
self.objectListButton = QAction(self)
self.objectListButton.setCheckable(True)
self.objectListButton.setEnabled(self.settings.value("pythonConsole/enableObjectInsp",
@@ -315,7 +315,7 @@ def __init__(self, parent=None):
self.clearButton.setToolTip(clearBt)
self.clearButton.setText(clearBt)
# Action for settings
optionsBt = QCoreApplication.translate("PythonConsole", "Options...")
optionsBt = QCoreApplication.translate("PythonConsole", "Options")
self.optionsButton = QAction(self)
self.optionsButton.setCheckable(False)
self.optionsButton.setEnabled(True)
@@ -335,7 +335,7 @@ def __init__(self, parent=None):
self.runButton.setToolTip(runBt)
self.runButton.setText(runBt)
# Help action
helpBt = QCoreApplication.translate("PythonConsole", "Help...")
helpBt = QCoreApplication.translate("PythonConsole", "Help")
self.helpButton = QAction(self)
self.helpButton.setCheckable(False)
self.helpButton.setEnabled(True)
@@ -433,7 +433,7 @@ def __init__(self, parent=None):
self.layoutFind = QGridLayout(self.widgetFind)
self.layoutFind.setContentsMargins(0, 0, 0, 0)
self.lineEditFind = QgsFilterLineEdit()
placeHolderTxt = QCoreApplication.translate("PythonConsole", "Enter text to find...")
placeHolderTxt = QCoreApplication.translate("PythonConsole", "Enter text to find")

self.lineEditFind.setPlaceholderText(placeHolderTxt)
self.toolBarFindText = QToolBar()
@@ -59,7 +59,7 @@ def _preparationFinished(self):
self._clearLexer()
if os.path.exists(self._pap_file):
os.remove(self._pap_file)
self.ui.label.setText(QCoreApplication.translate("PythonConsole", "Saving prepared file..."))
self.ui.label.setText(QCoreApplication.translate("PythonConsole", "Saving prepared file"))
prepd = self._api.savePrepared(self._pap_file)
rslt = self.tr("Error")
if prepd:
@@ -84,7 +84,7 @@ def prepareAPI(self):
except Exception as err:
self._api = None
self._clearLexer()
self.ui.label.setText(QCoreApplication.translate("PythonConsole", "Error preparing file..."))
self.ui.label.setText(QCoreApplication.translate("PythonConsole", "Error preparing file"))
self.ui.progressBar.setVisible(False)
self.ui.plainTextEdit.setVisible(True)
self.ui.plainTextEdit.insertPlainText(err)
@@ -346,7 +346,7 @@ def contextMenuEvent(self, e):
self.objectListEditor)
menu.addSeparator()
menu.addAction(iconSettings,
QCoreApplication.translate("PythonConsole", "Options..."),
QCoreApplication.translate("PythonConsole", "Options"),
self.parent.pc.openSettings)
syntaxCheck.setEnabled(False)
pasteAction.setEnabled(False)
@@ -236,7 +236,7 @@ def contextMenuEvent(self, e):
self.selectAll, QKeySequence.SelectAll)
menu.addSeparator()
menu.addAction(iconSettings,
QCoreApplication.translate("PythonConsole", "Options..."),
QCoreApplication.translate("PythonConsole", "Options"),
self.parent.openSettings)
runAction.setEnabled(False)
clearAction.setEnabled(False)
@@ -20,7 +20,7 @@
"""
from builtins import range

from qgis.PyQt.QtCore import QCoreApplication, QSize, QFileInfo, Qt
from qgis.PyQt.QtCore import QCoreApplication, QSize, Qt
from qgis.PyQt.QtWidgets import QDialog, QFileDialog, QMessageBox, QTableWidgetItem
from qgis.PyQt.QtGui import QIcon, QFont, QColor, QFontDatabase
from .console_compile_apis import PrepareAPIDialog
@@ -119,7 +119,8 @@ def accept(self):
not self.lineEdit.text():
QMessageBox.information(
self, self.tr("Warning!"),
self.tr('The APIs file was not compiled, click on "Compile APIs..."'))
QCoreApplication.translate('optionsDialog', 'The APIs file was not compiled, click on "Compile APIs…"')
)
return
self.saveSettings()
self.listPath = []
@@ -448,8 +448,10 @@ def setupUi(self):
sep.setVisible(False)

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…"),
QApplication.translate("DBManager", "&Import Layer/File…"),
self.importActionSlot)
self.actionExport = self.menuTable.addAction(QIcon(":/db_manager/actions/export"),
QApplication.translate("DBManager", "&Export to File…"),
self.exportActionSlot)
self.menuTable.addSeparator()
#self.actionShowSystemTables = self.menuTable.addAction(self.tr("Show system tables/views"), self.showSystemTables)
@@ -20,7 +20,7 @@
***************************************************************************/
"""

from qgis.PyQt.QtCore import pyqtSignal
from qgis.PyQt.QtCore import pyqtSignal, QCoreApplication
from qgis.PyQt.QtWidgets import QWidget, QTreeView, QMenu, QLabel

from qgis.core import Qgis, QgsProject, QgsMessageLog
@@ -125,8 +125,8 @@ def contextMenuEvent(self, ev):
menu = QMenu(self)

if isinstance(item, (Table, Schema)):
menu.addAction(self.tr("Rename…"), self.rename)
menu.addAction(self.tr("Delete…"), self.delete)
menu.addAction(QCoreApplication.translate("DBTree", "Rename…"), self.rename)
menu.addAction(QCoreApplication.translate("DBTree", "Delete…"), self.delete)

if isinstance(item, Table) and item.canBeAddedToCanvas():
menu.addSeparator()
@@ -138,7 +138,7 @@ def contextMenuEvent(self, ev):
menu.addAction(self.tr("Remove"), self.delete)

elif not index.parent().isValid() and item.typeName() in ("spatialite", "gpkg"):
menu.addAction(self.tr("New Connection…"), self.newConnection)
menu.addAction(QCoreApplication.translate("DBTree", "New Connection…"), self.newConnection)

if not menu.isEmpty():
menu.exec_(ev.globalPos())
@@ -197,7 +197,7 @@ def initGui(self):

self.modelerAction = QAction(
QgsApplication.getThemeIcon("/processingModel.svg"),
self.tr('Graphical &Modeler...'), self.iface.mainWindow())
QCoreApplication.translate('ProcessingPlugin', 'Graphical &Modeler'), self.iface.mainWindow())
self.modelerAction.setObjectName('modelerAction')
self.modelerAction.triggered.connect(self.openModeler)
self.iface.registerMainWindowAction(self.modelerAction,
@@ -206,7 +206,7 @@ def initGui(self):

self.historyAction = QAction(
QIcon(os.path.join(pluginPath, 'images', 'history.svg')),
self.tr('&History...'), self.iface.mainWindow())
QCoreApplication.translate('ProcessingPlugin', '&History'), self.iface.mainWindow())
self.historyAction.setObjectName('historyAction')
self.historyAction.triggered.connect(self.openHistory)
self.iface.registerMainWindowAction(self.historyAction,
@@ -25,6 +25,7 @@

__revision__ = '$Format:%H$'

from qgis.PyQt.QtCore import QCoreApplication
from math import sqrt

from qgis.core import (QgsFeature,
@@ -83,11 +84,11 @@ def processAlgorithm(self, parameters, context, feedback):
no_multigeom = self.parameterAsBool(parameters, self.NO_MULTIGEOMETRY, context)

# Delaunay triangulation from input point layer
feedback.setProgressText(self.tr('Creating Delaunay triangles...'))
feedback.setProgressText(QCoreApplication.translate('ConcaveHull', 'Creating Delaunay triangles'))
delaunay_layer = processing.run("qgis:delaunaytriangulation", {'INPUT': parameters[ConcaveHull.INPUT], 'OUTPUT': 'memory:'}, feedback=feedback, context=context)['OUTPUT']

# Get max edge length from Delaunay triangles
feedback.setProgressText(self.tr('Computing edges max length...'))
feedback.setProgressText(QCoreApplication.translate('Computing edges max length'))

features = delaunay_layer.getFeatures()
count = delaunay_layer.featureCount()
@@ -109,7 +110,7 @@ def processAlgorithm(self, parameters, context, feedback):
max_length = max(lengths)

# Get features with longest edge longer than alpha*max_length
feedback.setProgressText(self.tr('Removing features...'))
feedback.setProgressText(QCoreApplication.translate('ConcaveHull', 'Removing features'))
counter = 50. / len(edges)
i = 0
ids = []
@@ -126,11 +127,11 @@ def processAlgorithm(self, parameters, context, feedback):
delaunay_layer.dataProvider().deleteFeatures(ids)

# Dissolve all Delaunay triangles
feedback.setProgressText(self.tr('Dissolving Delaunay triangles...'))
feedback.setProgressText(QCoreApplication.translate('ConcaveHull', 'Dissolving Delaunay triangles'))
dissolved_layer = processing.run("native:dissolve", {'INPUT': delaunay_layer, 'OUTPUT': 'memory:'}, feedback=feedback, context=context)['OUTPUT']

# Save result
feedback.setProgressText(self.tr('Saving data...'))
feedback.setProgressText(QCoreApplication.translate('ConcaveHull', 'Saving data'))
feat = QgsFeature()
dissolved_layer.getFeatures().nextFeature(feat)

@@ -25,6 +25,7 @@

__revision__ = '$Format:%H$'

from qgis.PyQt.QtCore import QCoreApplication
from qgis.core import (QgsFields,
QgsFeature,
QgsFeatureSink,
@@ -81,7 +82,7 @@ def processAlgorithm(self, parameters, context, feedback):

allLinesList = []
features = source.getFeatures(QgsFeatureRequest().setSubsetOfAttributes([]))
feedback.pushInfo(self.tr('Processing lines...'))
feedback.pushInfo(QCoreApplication.translate('Polygonize', 'Processing lines'))
total = (40.0 / source.featureCount()) if source.featureCount() else 1
for current, inFeat in enumerate(features):
if feedback.isCanceled():
@@ -93,20 +94,20 @@ def processAlgorithm(self, parameters, context, feedback):

feedback.setProgress(40)

feedback.pushInfo(self.tr('Noding lines...'))
feedback.pushInfo(QCoreApplication.translate('Polygonize', 'Noding lines'))
allLines = QgsGeometry.unaryUnion(allLinesList)
if feedback.isCanceled():
return {}

feedback.setProgress(45)
feedback.pushInfo(self.tr('Polygonizing...'))
feedback.pushInfo(QCoreApplication.translate('Polygonize', 'Polygonizing'))
polygons = QgsGeometry.polygonize([allLines])
if polygons.isEmpty():
feedback.reportError(self.tr('No polygons were created!'))
feedback.setProgress(50)

if not polygons.isEmpty():
feedback.pushInfo('Saving polygons...')
feedback.pushInfo(QCoreApplication.translate('Polygonize', 'Saving polygons…'))
total = 50.0 / polygons.constGet().numGeometries()
for i in range(polygons.constGet().numGeometries()):
if feedback.isCanceled():

1 comment on commit 6dfedc3

@nyalldawson
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎂 Typology nerds rejoice!!! 💯

Please sign in to comment.