Skip to content

Commit 51d73a9

Browse files
committedMay 20, 2013
[pyqgis-console] fix translation string
1 parent 942d6bf commit 51d73a9

File tree

4 files changed

+69
-31
lines changed

4 files changed

+69
-31
lines changed
 

‎python/console/console.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def __init__(self, parent=None):
221221
self.runScriptEditorButton.setToolTip(runScriptEditorBt)
222222
self.runScriptEditorButton.setText(runScriptEditorBt)
223223
## Action Run Script (subprocess)
224-
commentEditorBt = QCoreApplication.translate("PythonConsole", "Comment code")
224+
commentEditorBt = QCoreApplication.translate("PythonConsole", "Comment")
225225
self.commentEditorButton = QAction(self)
226226
self.commentEditorButton.setCheckable(False)
227227
self.commentEditorButton.setEnabled(True)
@@ -231,7 +231,7 @@ def __init__(self, parent=None):
231231
self.commentEditorButton.setToolTip(commentEditorBt)
232232
self.commentEditorButton.setText(commentEditorBt)
233233
## Action Run Script (subprocess)
234-
uncommentEditorBt = QCoreApplication.translate("PythonConsole", "Uncomment code")
234+
uncommentEditorBt = QCoreApplication.translate("PythonConsole", "Uncomment")
235235
self.uncommentEditorButton = QAction(self)
236236
self.uncommentEditorButton.setCheckable(False)
237237
self.uncommentEditorButton.setEnabled(True)
@@ -252,7 +252,7 @@ def __init__(self, parent=None):
252252
self.objectListButton.setToolTip(objList)
253253
self.objectListButton.setText(objList)
254254
## Action for Find text
255-
findText = QCoreApplication.translate("PythonConsole", "Find text")
255+
findText = QCoreApplication.translate("PythonConsole", "Find Text")
256256
self.findTextButton = QAction(self)
257257
self.findTextButton.setCheckable(True)
258258
self.findTextButton.setEnabled(True)

‎python/console/console_editor.py

+45-18
Original file line numberDiff line numberDiff line change
@@ -271,53 +271,76 @@ def contextMenuEvent(self, e):
271271
iconSettings = QgsApplication.getThemeIcon("console/iconSettingsConsole.png")
272272
iconFind = QgsApplication.getThemeIcon("console/iconSearchEditorConsole.png")
273273
iconSyntaxCk = QgsApplication.getThemeIcon("console/iconSyntaxErrorConsole.png")
274-
hideEditorAction = menu.addAction("Hide Editor",
275-
self.hideEditor)
274+
iconObjInsp = QgsApplication.getThemeIcon("console/iconClassBrowserConsole.png")
275+
hideEditorAction = menu.addAction(QCoreApplication.translate("PythonConsole", "Hide Editor"),
276+
self.hideEditor)
276277
menu.addSeparator()
277-
syntaxCheck = menu.addAction(iconSyntaxCk, "Check Syntax",
278+
syntaxCheck = menu.addAction(iconSyntaxCk,
279+
QCoreApplication.translate("PythonConsole",
280+
"Check Syntax"),
278281
self.syntaxCheck, 'Ctrl+4')
279282
menu.addSeparator()
280283
runSelected = menu.addAction(iconRun,
281-
"Enter selected",
284+
QCoreApplication.translate("PythonConsole",
285+
"Enter selected"),
282286
self.runSelectedCode, 'Ctrl+E')
283287
runScript = menu.addAction(iconRunScript,
284-
"Run Script",
288+
QCoreApplication.translate("PythonConsole",
289+
"Run Script"),
285290
self.runScriptCode, 'Shift+Ctrl+E')
286291
menu.addSeparator()
287-
undoAction = menu.addAction("Undo", self.undo, QKeySequence.Undo)
288-
redoAction = menu.addAction("Redo", self.redo, 'Ctrl+Shift+Z')
292+
undoAction = menu.addAction(QCoreApplication.translate("PythonConsole",
293+
"Undo"),
294+
self.undo, QKeySequence.Undo)
295+
redoAction = menu.addAction(QCoreApplication.translate("PythonConsole",
296+
"Redo"),
297+
self.redo, 'Ctrl+Shift+Z')
289298
menu.addSeparator()
290299
findAction = menu.addAction(iconFind,
291-
"Find Text",
300+
QCoreApplication.translate("PythonConsole",
301+
"Find Text"),
292302
self.showFindWidget)
293303
menu.addSeparator()
294-
cutAction = menu.addAction("Cut",
304+
cutAction = menu.addAction(QCoreApplication.translate("PythonConsole",
305+
"Cut"),
295306
self.cut,
296307
QKeySequence.Cut)
297-
copyAction = menu.addAction("Copy",
308+
copyAction = menu.addAction(QCoreApplication.translate("PythonConsole",
309+
"Copy"),
298310
self.copy,
299311
QKeySequence.Copy)
300-
pasteAction = menu.addAction("Paste", self.paste, QKeySequence.Paste)
312+
pasteAction = menu.addAction(QCoreApplication.translate("PythonConsole",
313+
"Paste"),
314+
self.paste, QKeySequence.Paste)
301315
menu.addSeparator()
302-
commentCodeAction = menu.addAction(iconCommentEditor, "Comment",
316+
commentCodeAction = menu.addAction(iconCommentEditor,
317+
QCoreApplication.translate("PythonConsole",
318+
"Comment"),
303319
self.parent.pc.commentCode, 'Ctrl+3')
304-
uncommentCodeAction = menu.addAction(iconUncommentEditor, "Uncomment",
320+
uncommentCodeAction = menu.addAction(iconUncommentEditor,
321+
QCoreApplication.translate("PythonConsole",
322+
"Uncomment"),
305323
self.parent.pc.uncommentCode,
306324
'Shift+Ctrl+3')
307325
menu.addSeparator()
308326
codePadAction = menu.addAction(iconCodePad,
309-
"Share on codepad",
310-
self.codepad)
327+
QCoreApplication.translate("PythonConsole",
328+
"Share on codepad"),
329+
self.codepad)
311330
menu.addSeparator()
312-
showCodeInspection = menu.addAction("Hide/Show Object list",
331+
showCodeInspection = menu.addAction(iconObjInsp,
332+
QCoreApplication.translate("PythonConsole",
333+
"Hide/Show Object Inspector"),
313334
self.objectListEditor)
314335
menu.addSeparator()
315-
selectAllAction = menu.addAction("Select All",
336+
selectAllAction = menu.addAction(QCoreApplication.translate("PythonConsole",
337+
"Select All"),
316338
self.selectAll,
317339
QKeySequence.SelectAll)
318340
menu.addSeparator()
319341
settingsDialog = menu.addAction(iconSettings,
320-
"Settings",
342+
QCoreApplication.translate("PythonConsole",
343+
"Settings"),
321344
self.parent.pc.openSettings)
322345
syntaxCheck.setEnabled(False)
323346
pasteAction.setEnabled(False)
@@ -328,6 +351,7 @@ def contextMenuEvent(self, e):
328351
selectAllAction.setEnabled(False)
329352
undoAction.setEnabled(False)
330353
redoAction.setEnabled(False)
354+
showCodeInspection.setEnabled(False)
331355
if self.hasSelectedText():
332356
runSelected.setEnabled(True)
333357
copyAction.setEnabled(True)
@@ -342,6 +366,9 @@ def contextMenuEvent(self, e):
342366
redoAction.setEnabled(True)
343367
if QApplication.clipboard().text():
344368
pasteAction.setEnabled(True)
369+
if self.settings.value("pythonConsole/enableObjectInsp",
370+
False).toBool():
371+
showCodeInspection.setEnabled(True)
345372
action = menu.exec_(self.mapToGlobal(e.pos()))
346373

347374
def findText(self, forward):

‎python/console/console_output.py

+15-8
Original file line numberDiff line numberDiff line change
@@ -176,30 +176,37 @@ def contextMenuEvent(self, e):
176176
iconHideTool = QgsApplication.getThemeIcon("console/iconHideToolConsole.png")
177177
iconSettings = QgsApplication.getThemeIcon("console/iconSettingsConsole.png")
178178
hideToolBar = menu.addAction(iconHideTool,
179-
"Hide/Show Toolbar",
179+
QCoreApplication.translate("PythonConsole",
180+
"Hide/Show Toolbar"),
180181
self.hideToolBar)
181182
menu.addSeparator()
182-
showEditorAction = menu.addAction("Show Editor",
183-
self.showEditor)
183+
showEditorAction = menu.addAction(QCoreApplication.translate("PythonConsole",
184+
"Show Editor"),
185+
self.showEditor)
184186
menu.addSeparator()
185187
runAction = menu.addAction(iconRun,
186-
"Enter Selected",
188+
QCoreApplication.translate("PythonConsole",
189+
"Enter Selected"),
187190
self.enteredSelected,
188191
QKeySequence(Qt.CTRL + Qt.Key_E))
189192
clearAction = menu.addAction(iconClear,
190-
"Clear console",
193+
QCoreApplication.translate("PythonConsole",
194+
"Clear console"),
191195
self.clearConsole)
192196
menu.addSeparator()
193-
copyAction = menu.addAction("Copy",
197+
copyAction = menu.addAction(QCoreApplication.translate("PythonConsole",
198+
"Copy"),
194199
self.copy,
195200
QKeySequence.Copy)
196201
menu.addSeparator()
197-
selectAllAction = menu.addAction("Select All",
202+
selectAllAction = menu.addAction(QCoreApplication.translate("PythonConsole",
203+
"Select All"),
198204
self.selectAll,
199205
QKeySequence.SelectAll)
200206
menu.addSeparator()
201207
settingsDialog = menu.addAction(iconSettings,
202-
"Settings",
208+
QCoreApplication.translate("PythonConsole",
209+
"Settings"),
203210
self.parent.openSettings)
204211
runAction.setEnabled(False)
205212
clearAction.setEnabled(False)

‎python/console/console_sci.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,12 @@ def keyPressEvent(self, e):
402402

403403
def contextMenuEvent(self, e):
404404
menu = QMenu(self)
405-
copyAction = menu.addAction("Copy", self.copy, QKeySequence.Copy)
406-
pasteAction = menu.addAction("Paste", self.paste, QKeySequence.Paste)
405+
copyAction = menu.addAction(QCoreApplication.translate("PythonConsole",
406+
"Copy"),
407+
self.copy, QKeySequence.Copy)
408+
pasteAction = menu.addAction(QCoreApplication.translate("PythonConsole",
409+
"Paste"),
410+
self.paste, QKeySequence.Paste)
407411
copyAction.setEnabled(False)
408412
pasteAction.setEnabled(False)
409413
if self.hasSelectedText():

0 commit comments

Comments
 (0)
Please sign in to comment.