Skip to content

Commit 6dfedc3

Browse files
committed
translation string fixes and cleanups
1 parent fa815f0 commit 6dfedc3

27 files changed

+178
-171
lines changed

python/console/console.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def __init__(self, parent=None):
171171
# ------------------Toolbar Editor-------------------------------------
172172

173173
# Action for Open File
174-
openFileBt = QCoreApplication.translate("PythonConsole", "Open Script...")
174+
openFileBt = QCoreApplication.translate("PythonConsole", "Open Script")
175175
self.openFileButton = QAction(self)
176176
self.openFileButton.setCheckable(False)
177177
self.openFileButton.setEnabled(True)
@@ -201,7 +201,7 @@ def __init__(self, parent=None):
201201
self.saveFileButton.setToolTip(saveFileBt)
202202
self.saveFileButton.setText(saveFileBt)
203203
# Action for Save File As
204-
saveAsFileBt = QCoreApplication.translate("PythonConsole", "Save As...")
204+
saveAsFileBt = QCoreApplication.translate("PythonConsole", "Save As")
205205
self.saveAsFileButton = QAction(self)
206206
self.saveAsFileButton.setCheckable(False)
207207
self.saveAsFileButton.setEnabled(True)
@@ -271,7 +271,7 @@ def __init__(self, parent=None):
271271
self.uncommentEditorButton.setToolTip(uncommentEditorBt)
272272
self.uncommentEditorButton.setText(uncommentEditorBt)
273273
# Action for Object browser
274-
objList = QCoreApplication.translate("PythonConsole", "Object Inspector...")
274+
objList = QCoreApplication.translate("PythonConsole", "Object Inspector")
275275
self.objectListButton = QAction(self)
276276
self.objectListButton.setCheckable(True)
277277
self.objectListButton.setEnabled(self.settings.value("pythonConsole/enableObjectInsp",
@@ -315,7 +315,7 @@ def __init__(self, parent=None):
315315
self.clearButton.setToolTip(clearBt)
316316
self.clearButton.setText(clearBt)
317317
# Action for settings
318-
optionsBt = QCoreApplication.translate("PythonConsole", "Options...")
318+
optionsBt = QCoreApplication.translate("PythonConsole", "Options")
319319
self.optionsButton = QAction(self)
320320
self.optionsButton.setCheckable(False)
321321
self.optionsButton.setEnabled(True)
@@ -335,7 +335,7 @@ def __init__(self, parent=None):
335335
self.runButton.setToolTip(runBt)
336336
self.runButton.setText(runBt)
337337
# Help action
338-
helpBt = QCoreApplication.translate("PythonConsole", "Help...")
338+
helpBt = QCoreApplication.translate("PythonConsole", "Help")
339339
self.helpButton = QAction(self)
340340
self.helpButton.setCheckable(False)
341341
self.helpButton.setEnabled(True)
@@ -433,7 +433,7 @@ def __init__(self, parent=None):
433433
self.layoutFind = QGridLayout(self.widgetFind)
434434
self.layoutFind.setContentsMargins(0, 0, 0, 0)
435435
self.lineEditFind = QgsFilterLineEdit()
436-
placeHolderTxt = QCoreApplication.translate("PythonConsole", "Enter text to find...")
436+
placeHolderTxt = QCoreApplication.translate("PythonConsole", "Enter text to find")
437437

438438
self.lineEditFind.setPlaceholderText(placeHolderTxt)
439439
self.toolBarFindText = QToolBar()

python/console/console_compile_apis.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def _preparationFinished(self):
5959
self._clearLexer()
6060
if os.path.exists(self._pap_file):
6161
os.remove(self._pap_file)
62-
self.ui.label.setText(QCoreApplication.translate("PythonConsole", "Saving prepared file..."))
62+
self.ui.label.setText(QCoreApplication.translate("PythonConsole", "Saving prepared file"))
6363
prepd = self._api.savePrepared(self._pap_file)
6464
rslt = self.tr("Error")
6565
if prepd:
@@ -84,7 +84,7 @@ def prepareAPI(self):
8484
except Exception as err:
8585
self._api = None
8686
self._clearLexer()
87-
self.ui.label.setText(QCoreApplication.translate("PythonConsole", "Error preparing file..."))
87+
self.ui.label.setText(QCoreApplication.translate("PythonConsole", "Error preparing file"))
8888
self.ui.progressBar.setVisible(False)
8989
self.ui.plainTextEdit.setVisible(True)
9090
self.ui.plainTextEdit.insertPlainText(err)

python/console/console_editor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def contextMenuEvent(self, e):
346346
self.objectListEditor)
347347
menu.addSeparator()
348348
menu.addAction(iconSettings,
349-
QCoreApplication.translate("PythonConsole", "Options..."),
349+
QCoreApplication.translate("PythonConsole", "Options"),
350350
self.parent.pc.openSettings)
351351
syntaxCheck.setEnabled(False)
352352
pasteAction.setEnabled(False)

python/console/console_output.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def contextMenuEvent(self, e):
236236
self.selectAll, QKeySequence.SelectAll)
237237
menu.addSeparator()
238238
menu.addAction(iconSettings,
239-
QCoreApplication.translate("PythonConsole", "Options..."),
239+
QCoreApplication.translate("PythonConsole", "Options"),
240240
self.parent.openSettings)
241241
runAction.setEnabled(False)
242242
clearAction.setEnabled(False)

python/console/console_settings.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"""
2121
from builtins import range
2222

23-
from qgis.PyQt.QtCore import QCoreApplication, QSize, QFileInfo, Qt
23+
from qgis.PyQt.QtCore import QCoreApplication, QSize, Qt
2424
from qgis.PyQt.QtWidgets import QDialog, QFileDialog, QMessageBox, QTableWidgetItem
2525
from qgis.PyQt.QtGui import QIcon, QFont, QColor, QFontDatabase
2626
from .console_compile_apis import PrepareAPIDialog
@@ -119,7 +119,8 @@ def accept(self):
119119
not self.lineEdit.text():
120120
QMessageBox.information(
121121
self, self.tr("Warning!"),
122-
self.tr('The APIs file was not compiled, click on "Compile APIs..."'))
122+
QCoreApplication.translate('optionsDialog', 'The APIs file was not compiled, click on "Compile APIs…"')
123+
)
123124
return
124125
self.saveSettings()
125126
self.listPath = []

python/plugins/db_manager/db_manager.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,10 @@ def setupUi(self):
448448
sep.setVisible(False)
449449

450450
self.actionImport = self.menuTable.addAction(QIcon(":/db_manager/actions/import"),
451-
self.tr("&Import Layer/File…"), self.importActionSlot)
452-
self.actionExport = self.menuTable.addAction(QIcon(":/db_manager/actions/export"), self.tr("&Export to File…"),
451+
QApplication.translate("DBManager", "&Import Layer/File…"),
452+
self.importActionSlot)
453+
self.actionExport = self.menuTable.addAction(QIcon(":/db_manager/actions/export"),
454+
QApplication.translate("DBManager", "&Export to File…"),
453455
self.exportActionSlot)
454456
self.menuTable.addSeparator()
455457
#self.actionShowSystemTables = self.menuTable.addAction(self.tr("Show system tables/views"), self.showSystemTables)

python/plugins/db_manager/db_tree.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
***************************************************************************/
2121
"""
2222

23-
from qgis.PyQt.QtCore import pyqtSignal
23+
from qgis.PyQt.QtCore import pyqtSignal, QCoreApplication
2424
from qgis.PyQt.QtWidgets import QWidget, QTreeView, QMenu, QLabel
2525

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

127127
if isinstance(item, (Table, Schema)):
128-
menu.addAction(self.tr("Rename…"), self.rename)
129-
menu.addAction(self.tr("Delete…"), self.delete)
128+
menu.addAction(QCoreApplication.translate("DBTree", "Rename…"), self.rename)
129+
menu.addAction(QCoreApplication.translate("DBTree", "Delete…"), self.delete)
130130

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

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

143143
if not menu.isEmpty():
144144
menu.exec_(ev.globalPos())

python/plugins/processing/ProcessingPlugin.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ def initGui(self):
197197

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

207207
self.historyAction = QAction(
208208
QIcon(os.path.join(pluginPath, 'images', 'history.svg')),
209-
self.tr('&History...'), self.iface.mainWindow())
209+
QCoreApplication.translate('ProcessingPlugin', '&History'), self.iface.mainWindow())
210210
self.historyAction.setObjectName('historyAction')
211211
self.historyAction.triggered.connect(self.openHistory)
212212
self.iface.registerMainWindowAction(self.historyAction,

python/plugins/processing/algs/qgis/ConcaveHull.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
__revision__ = '$Format:%H$'
2727

28+
from qgis.PyQt.QtCore import QCoreApplication
2829
from math import sqrt
2930

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

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

8990
# Get max edge length from Delaunay triangles
90-
feedback.setProgressText(self.tr('Computing edges max length...'))
91+
feedback.setProgressText(QCoreApplication.translate('Computing edges max length'))
9192

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

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

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

132133
# Save result
133-
feedback.setProgressText(self.tr('Saving data...'))
134+
feedback.setProgressText(QCoreApplication.translate('ConcaveHull', 'Saving data'))
134135
feat = QgsFeature()
135136
dissolved_layer.getFeatures().nextFeature(feat)
136137

python/plugins/processing/algs/qgis/Polygonize.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
__revision__ = '$Format:%H$'
2727

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

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

9495
feedback.setProgress(40)
9596

96-
feedback.pushInfo(self.tr('Noding lines...'))
97+
feedback.pushInfo(QCoreApplication.translate('Polygonize', 'Noding lines'))
9798
allLines = QgsGeometry.unaryUnion(allLinesList)
9899
if feedback.isCanceled():
99100
return {}
100101

101102
feedback.setProgress(45)
102-
feedback.pushInfo(self.tr('Polygonizing...'))
103+
feedback.pushInfo(QCoreApplication.translate('Polygonize', 'Polygonizing'))
103104
polygons = QgsGeometry.polygonize([allLines])
104105
if polygons.isEmpty():
105106
feedback.reportError(self.tr('No polygons were created!'))
106107
feedback.setProgress(50)
107108

108109
if not polygons.isEmpty():
109-
feedback.pushInfo('Saving polygons...')
110+
feedback.pushInfo(QCoreApplication.translate('Polygonize', 'Saving polygons…'))
110111
total = 50.0 / polygons.constGet().numGeometries()
111112
for i in range(polygons.constGet().numGeometries()):
112113
if feedback.isCanceled():

0 commit comments

Comments
 (0)