diff --git a/python/plugins/osm/OsmAddRelationDlg.py b/python/plugins/osm/OsmAddRelationDlg.py index 9fd9a84a812d..c7a48d69f920 100755 --- a/python/plugins/osm/OsmAddRelationDlg.py +++ b/python/plugins/osm/OsmAddRelationDlg.py @@ -61,8 +61,8 @@ def __init__(self, plugin, newRelationFirstMember=None, relationToEdit=None): # we are editing existing relation self.editing = True self.relId = relationToEdit - self.createRelButton.setText("Save") - self.setWindowTitle("Edit OSM relation") + self.createRelButton.setText( self.tr("Save") ) + self.setWindowTitle( self.tr("Edit OSM relation") ) else: self.editing = False # we are adding new relation @@ -790,18 +790,14 @@ def __showTypeInfo(self): info = "" if typeName=="boundary": - info = "for grouping boundaries and marking enclaves / exclaves" + info = QCoreApplication.translate( "OsmAddRelationDlg", "for grouping boundaries and marking enclaves / exclaves" ) elif typeName=="multipolygon": - info = "to put holes into areas (might have to be renamed, see article)" + info = QCoreApplication.translate( "OsmAddRelationDlg", "to put holes into areas (might have to be renamed, see article)" ) elif typeName=="restriction": - info = "any kind of turn restriction" + info = QCoreApplication.translate( "OsmAddRelationDlg", "any kind of turn restriction" ) elif typeName=="route": - info = "like bus routes, cycle routes and numbered highways" + info = QCoreApplication.translate( "OsmAddRelationDlg", "like bus routes, cycle routes and numbered highways" ) elif typeName=="enforcement": - info = "traffic enforcement devices; speed cameras, redlight cameras, weight checks, ..." - - QMessageBox.information(self, self.tr("OSM Information") - ,self.tr(info)) - - + info = QCoreApplication.translate( "OsmAddRelationDlg", "traffic enforcement devices; speed cameras, redlight cameras, weight checks, ..." ) + QMessageBox.information(self, self.tr("OSM Information"), info) diff --git a/python/plugins/osm/OsmDownloadDlg.py b/python/plugins/osm/OsmDownloadDlg.py index 0a0624661846..153eb1ed8f94 100755 --- a/python/plugins/osm/OsmDownloadDlg.py +++ b/python/plugins/osm/OsmDownloadDlg.py @@ -262,7 +262,7 @@ def httpDone(self,error): # and tell user (if the download wasn't cancelled by user) if self.errMessage != "__cancel__": if self.errMessage==None: - self.errMessage="Check your internet connection" + self.errMessage=QCoreApplication.translate( "OsmDownloadDlg", "Check your internet connection" ) QMessageBox.information(self, self.tr("OSM Download Error") ,self.tr("Download failed: %1.").arg(self.errMessage)) return @@ -302,7 +302,7 @@ def showChooseDirectoryDialog(self): """ # display file open dialog and get absolute path to selected directory - fileSelected = QFileDialog.getSaveFileName(self, "Choose file to save","download.osm", "OSM Files (*.osm)"); + fileSelected = QFileDialog.getSaveFileName(self, self.tr("Choose file to save"),"download.osm", self.tr("OSM Files (*.osm)") ); # insert selected directory path into line edit control if not fileSelected.isNull(): self.destdirLineEdit.setText(fileSelected) @@ -339,7 +339,7 @@ def autoLoadClicked(self): def showExtentHelp(self): """Function is called after clicking on Help button. - It shows basic information on downloading. + It shows basic information on downloading. """ mb=QMessageBox() @@ -464,6 +464,3 @@ def disconnectDlgSignals(self): self.disconnect(self.downloadButton, SIGNAL("clicked()"), self.downloadFile) self.disconnect(self.choosedirButton, SIGNAL("clicked()"), self.showChooseDirectoryDialog) self.disconnect(self.autoLoadCheckBox, SIGNAL("clicked()"), self.autoLoadClicked) - - - diff --git a/python/plugins/osm/OsmFeatureDW.py b/python/plugins/osm/OsmFeatureDW.py index b2b5f6cfa208..9e3a379acc2f 100755 --- a/python/plugins/osm/OsmFeatureDW.py +++ b/python/plugins/osm/OsmFeatureDW.py @@ -622,7 +622,7 @@ def __startMovingFeature(self): # clear dockwidget self.clear() - self.plugin.iface.mainWindow().statusBar().showMessage("Snapping ON. Hold Ctrl to disable it.") + self.plugin.iface.mainWindow().statusBar().showMessage(self.tr("Snapping ON. Hold Ctrl to disable it.")) self.mapTool=OsmMoveMT(self.plugin) self.plugin.canvas.setMapTool(self.mapTool) @@ -639,7 +639,7 @@ def __startPointCreation(self): if self.activeEditButton==self.createPointButton: return - self.plugin.iface.mainWindow().statusBar().showMessage("Snapping ON. Hold Ctrl to disable it.") + self.plugin.iface.mainWindow().statusBar().showMessage(self.tr("Snapping ON. Hold Ctrl to disable it.")) self.mapTool=OsmCreatePointMT(self.plugin) self.plugin.canvas.setMapTool(self.mapTool) @@ -656,7 +656,7 @@ def __startLineCreation(self): if self.activeEditButton==self.createLineButton: return - self.plugin.iface.mainWindow().statusBar().showMessage("Snapping ON. Hold Ctrl to disable it.") + self.plugin.iface.mainWindow().statusBar().showMessage(self.tr("Snapping ON. Hold Ctrl to disable it.")) self.mapTool=OsmCreateLineMT(self.plugin) self.plugin.canvas.setMapTool(self.mapTool) @@ -673,7 +673,7 @@ def __startPolygonCreation(self): if self.activeEditButton==self.createPolygonButton: return - self.plugin.iface.mainWindow().statusBar().showMessage("Snapping ON. Hold Ctrl to disable it.") + self.plugin.iface.mainWindow().statusBar().showMessage(self.tr("Snapping ON. Hold Ctrl to disable it.")) self.mapTool=OsmCreatePolygonMT(self.plugin) self.plugin.canvas.setMapTool(self.mapTool) @@ -770,7 +770,7 @@ def removeSelectedTags(self): elif self.featureType=='Relation': self.plugin.dbm.changeRelationStatus(self.feature.id(),'N','U') - # perform tag removing + # perform tag removing self.plugin.dbm.removeTag(self.feature.id(),self.featureType,key.toAscii().data()) self.tagTable.removeRow(ix) @@ -1254,9 +1254,7 @@ def __urDetailsChecked(self): if self.urDetailsButton.isChecked(): self.plugin.undoredo.show() - self.urDetailsButton.setToolTip("Hide OSM Edit History") + self.urDetailsButton.setToolTip(self.tr("Hide OSM Edit History")) else: self.plugin.undoredo.hide() - self.urDetailsButton.setToolTip("Show OSM Edit History") - - + self.urDetailsButton.setToolTip(self.tr("Show OSM Edit History")) diff --git a/python/plugins/osm/OsmImportDlg.py b/python/plugins/osm/OsmImportDlg.py index 2577c49d04a5..67011efc3bfa 100755 --- a/python/plugins/osm/OsmImportDlg.py +++ b/python/plugins/osm/OsmImportDlg.py @@ -101,10 +101,10 @@ def onOK(self): layer = QgsMapLayerRegistry.instance().mapLayer(layerId) if layer is None: - QMessageBox.warning(self, "Layer doesn't exist", "The selected layer doesn't exist anymore!") + QMessageBox.warning(self, self.tr("Layer doesn't exist"), self.tr("The selected layer doesn't exist anymore!")) return - self.progress = QProgressDialog("Importing features...", "Cancel", 0, 100, self) + self.progress = QProgressDialog(self.tr("Importing features..."), self.tr("Cancel"), 0, 100, self) self.progress.setWindowModality(Qt.WindowModal) self.nodes = { } @@ -135,7 +135,7 @@ def onOK(self): self.dbm.recacheAffectedNow(self.affected) self.plugin.canvas.refresh() - QMessageBox.information(self, "Import", "Import has been completed.") + QMessageBox.information(self, self.tr("Import"), self.tr("Import has been completed.")) self.accept() @@ -249,4 +249,3 @@ def extractPolygon(self, polygon): dp = dummyPoint(p[0]) self.nodes[dp] = dummyFeat(nodeId) nodeId -= 1 - diff --git a/python/plugins/osm/OsmLoadDlg.py b/python/plugins/osm/OsmLoadDlg.py index 26b89eea4bed..18bc3f81e5c0 100755 --- a/python/plugins/osm/OsmLoadDlg.py +++ b/python/plugins/osm/OsmLoadDlg.py @@ -85,7 +85,7 @@ def showOpenFileDialog(self): lastDir=settings.value("/OSM_Plugin/lastDir", QVariant(QString())).toString() # display file open dialog and get absolute path to selected file - fileSelected=QFileDialog.getOpenFileName(self,"Choose an Open Street Map file",lastDir,"OSM Files (*.osm)"); + fileSelected=QFileDialog.getOpenFileName(self,self.tr("Choose an Open Street Map file"),lastDir,self.tr("OSM Files (*.osm)")); # insert OSM file path into line edit control if not fileSelected.isNull(): self.OSMFileEdit.setText(fileSelected) @@ -108,7 +108,7 @@ def onOK(self): self.fname = self.OSMFileEdit.text() if self.fname=='': - QMessageBox.information(self, "OSM Load", QString("Please enter path to OSM data file.")) + QMessageBox.information(self, self.tr("OSM Load"),self.tr("Please enter path to OSM data file.")) self.buttonBox.setEnabled(True) return @@ -117,7 +117,7 @@ def onOK(self): basename = osmfile.baseName() if not osmfile.exists(): - QMessageBox.information(self, "OSM Load", QString("Path to OSM file is invalid: %1.").arg(self.fname)) + QMessageBox.information(self, self.tr("OSM Load"), self.tr("Path to OSM file is invalid: %1.").arg(self.fname)) return fLoaded=self.filesLoaded() @@ -126,11 +126,11 @@ def onOK(self): curDB=self.dbm.currentKey if basename in fLoaded and newDB<>curDB: - QMessageBox.information(self, "Error", QString("Layers of OSM file \"%1\" are loaded already.").arg(self.fname)) + QMessageBox.information(self, self.tr("Error"), self.tr("Layers of OSM file \"%1\" are loaded already.").arg(self.fname)) return - if replacing: - # remove layers of current data first + if replacing: + # remove layers of current data first QgsMapLayerRegistry.instance().removeMapLayer(self.canvas.currentLayer().id(),True) if self.chkCustomRenderer.isChecked(): @@ -162,7 +162,7 @@ def onOK(self): polygonLayer=None return if not polygonLayer.isValid(): - QMessageBox.information(self,"Error",QString("Failed to load polygon layer.")) + QMessageBox.information(self,self.tr("Error"),self.tr("Failed to load polygon layer.")) return if self.chkCustomRenderer.isChecked(): @@ -176,7 +176,7 @@ def onOK(self): lineLayer=None return if not lineLayer.isValid(): - QMessageBox.information(self,"Error",QString("Failed to load line layer.")) + QMessageBox.information(self,self.tr("Error"),self.tr("Failed to load line layer.")) return if self.chkCustomRenderer.isChecked(): @@ -190,7 +190,7 @@ def onOK(self): pointLayer=None return if not pointLayer.isValid(): - QMessageBox.information(self,"Error",QString("Failed to load point layer.")) + QMessageBox.information(self,self.tr("Error"),self.tr("Failed to load point layer.")) return if self.chkCustomRenderer.isChecked(): @@ -231,7 +231,7 @@ def setCustomRenderer(self, layer): self.emit( SIGNAL( "setRenderer(QgsVectorLayer *)" ), layer ) QObject.disconnect( self, SIGNAL( "setRenderer(QgsVectorLayer *)" ), layer.dataProvider(), SLOT( "setRenderer( QgsVectorLayer * )" ) ) else: - QMessageBox.information(self, "OSM Load", QString("Could not connect to setRenderer signal.")) + QMessageBox.information(self, self.tr("OSM Load"), self.tr("Could not connect to setRenderer signal.")) def filesLoaded(self): """Function returns list of keys of all currently loaded vector layers. @@ -303,11 +303,9 @@ def event(self, e): QObject.disconnect(self.progress,SIGNAL("canceled()"),self.cancelLoading) self.progress.close() self.progress = None - QMessageBox.information(self,"Error",QString("Failed to load layers: %1") + QMessageBox.information(self,self.tr("Error"),self.tr("Failed to load layers: %1") .arg(self.property("osm_failure").toString())) self.buttonBox.setEnabled(True) qApp.processEvents() return QDialog.event(self,e) - - diff --git a/python/plugins/osm/OsmPlugin.py b/python/plugins/osm/OsmPlugin.py index 5cb4d3fb4856..85790c0bbf3c 100755 --- a/python/plugins/osm/OsmPlugin.py +++ b/python/plugins/osm/OsmPlugin.py @@ -73,28 +73,28 @@ def initGui(self): # create action for loading OSM file self.actionLoad=QAction(QIcon(":/plugins/osm_plugin/images/osm_load.png") - ,"Load OSM from file", self.iface.mainWindow()) - self.actionLoad.setWhatsThis("Load OpenStreetMap from file") + ,QCoreApplication.translate( "OsmPlugin", "Load OSM from file"), self.iface.mainWindow()) + self.actionLoad.setWhatsThis( QCoreApplication.translate( "OsmPlugin", "Load OpenStreetMap from file") ) # create action for import of a layer into OSM self.actionImport=QAction(QIcon(":/plugins/osm_plugin/images/osm_import.png") - ,"Import data from a layer", self.iface.mainWindow()) - self.actionImport.setWhatsThis("Import data from a layer to OpenStreetMap") + ,QCoreApplication.translate( "OsmPlugin", "Import data from a layer"), self.iface.mainWindow()) + self.actionImport.setWhatsThis(QCoreApplication.translate( "OsmPlugin", "Import data from a layer to OpenStreetMap") ) # create action for saving OSM file self.actionSave=QAction(QIcon(":/plugins/osm_plugin/images/osm_save.png") - ,"Save OSM to file", self.iface.mainWindow()) - self.actionSave.setWhatsThis("Save OpenStreetMap to file") + ,QCoreApplication.translate( "OsmPlugin", "Save OSM to file"), self.iface.mainWindow()) + self.actionSave.setWhatsThis(QCoreApplication.translate( "OsmPlugin", "Save OpenStreetMap to file") ) # create action for OSM data downloading self.actionDownload=QAction(QIcon(":/plugins/osm_plugin/images/osm_download.png") - ,"Download OSM data", self.iface.mainWindow()) - self.actionDownload.setWhatsThis("Download OpenStreetMap data") + ,QCoreApplication.translate( "OsmPlugin", "Download OSM data"), self.iface.mainWindow()) + self.actionDownload.setWhatsThis(QCoreApplication.translate( "OsmPlugin", "Download OpenStreetMap data") ) # create action for OSM data downloading self.actionUpload=QAction(QIcon(":/plugins/osm_plugin/images/osm_upload.png") - ,"Upload OSM data", self.iface.mainWindow()) - self.actionUpload.setWhatsThis("Upload OpenStreetMap data") + ,QCoreApplication.translate( "OsmPlugin", "Upload OSM data"), self.iface.mainWindow()) + self.actionUpload.setWhatsThis(QCoreApplication.translate( "OsmPlugin", "Upload OpenStreetMap data") ) # create action for OSM dockable window self.actionDockWidget=QAction(QIcon(":/plugins/osm_plugin/images/osm_featureManager.png") - ,"Show/Hide OSM Feature Manager",self.iface.mainWindow()) - self.actionDockWidget.setWhatsThis("Show/Hide OpenStreetMap Feature Manager") + ,QCoreApplication.translate( "OsmPlugin", "Show/Hide OSM Feature Manager"),self.iface.mainWindow()) + self.actionDockWidget.setWhatsThis(QCoreApplication.translate( "OsmPlugin", "Show/Hide OpenStreetMap Feature Manager") ) self.actionDockWidget.setCheckable(True) # connect new action to plugin function - when action is triggered @@ -193,7 +193,8 @@ def loadOsmFromFile(self): # sanity check whether we're able to load osm data if 'osm' not in QgsProviderRegistry.instance().providerList(): - QMessageBox.critical(None, "Sorry", "You don't have OSM provider installed!") + QMessageBox.critical(None, QCoreApplication.translate( "OsmPlugin", "Sorry" ), + QCoreApplication.translate( "OsmPlugin", "You don't have OSM provider installed!") ) return # show modal dialog with OSM file selection @@ -222,13 +223,14 @@ def saveOsmToFile(self): """ if 'osm' not in QgsProviderRegistry.instance().providerList(): - QMessageBox.critical(None, "Sorry", "You don't have OSM provider installed!") + QMessageBox.critical(None, QCoreApplication.translate( "OsmPlugin", "Sorry" ), + QCoreApplication.translate( "OsmPlugin", "You don't have OSM provider installed!") ) return if not self.dbm.currentKey: - QMessageBox.information(QWidget(), QString("OSM Save to file") - ,"No OSM data are loaded/downloaded or no OSM layer is selected in Layers panel. \ -Please change this situation first, because OSM Plugin doesn't know what to save.") + QMessageBox.information(QWidget(), QCoreApplication.translate( "OsmPlugin", "OSM Save to file"), + QCoreApplication.translate( "OsmPlugin", "No OSM data are loaded/downloaded or no OSM layer is selected in Layers panel. \ +Please change this situation first, because OSM Plugin doesn't know what to save.") ) return # show modal dialog with OSM file selection @@ -247,7 +249,8 @@ def downloadOsmData(self): """ if 'osm' not in QgsProviderRegistry.instance().providerList(): - QMessageBox.critical(None, "Sorry", "You don't have OSM provider installed!") + QMessageBox.critical(None, QCoreApplication.translate( "OsmPlugin", "Sorry" ), + QCoreApplication.translate( "OsmPlugin", "You don't have OSM provider installed!") ) return self.dlgDownload=OsmDownloadDlg(self) @@ -299,9 +302,9 @@ def uploadOsmData(self): # first check if there are some data; if not upload doesn't have sense if not self.dbm.currentKey: - QMessageBox.information(QWidget(), QString("OSM Upload") - ,"No OSM data are loaded/downloaded or no OSM layer is selected in Layers panel. \ -Please change this situation first, because OSM Plugin doesn't know what to upload.") + QMessageBox.information(QWidget(), QCoreApplication.translate( "OsmPlugin", "OSM Upload"), + QCoreApplication.translate( "OsmPlugin", "No OSM data are loaded/downloaded or no OSM layer is selected in Layers panel. \ +Please change this situation first, because OSM Plugin doesn't know what to upload.") ) return self.dlgUpload=OsmUploadDlg(self) @@ -316,18 +319,20 @@ def importData(self): """ if 'osm' not in QgsProviderRegistry.instance().providerList(): - QMessageBox.critical(None, "Sorry", "You don't have OSM provider installed!") + QMessageBox.critical(None, QCoreApplication.translate( "OsmPlugin", "Sorry"), + QCoreApplication.translate( "OsmPlugin", "You don't have OSM provider installed!") ) return if self.dbm.currentKey is None: - QMessageBox.information(self.iface.mainWindow(), "OSM Import" - ,"No OSM data are loaded/downloaded or no OSM layer is selected in Layers panel. \ -Please change this situation first, because OSM Plugin doesn't know what layer will be destination of the import.") + QMessageBox.information(self.iface.mainWindow(), QCoreApplication.translate( "OsmPlugin", "OSM Import"), + QCoreApplication.translate( "OsmPlugin", "No OSM data are loaded/downloaded or no OSM layer is selected in Layers panel. \ +Please change this situation first, because OSM Plugin doesn't know what layer will be destination of the import.") ) return dlg=OsmImportDlg(self) if dlg.cboLayer.count()==0: - QMessageBox.information(self.iface.mainWindow(), "OSM Import", "There are currently no available vector layers.") + QMessageBox.information(self.iface.mainWindow(), QCoreApplication.translate( "OsmPlugin", "OSM Import"), + QCoreApplication.translate( "OsmPlugin", "There are currently no available vector layers.") ) return dlg.exec_() @@ -367,5 +372,3 @@ def __ofVisibilityChanged(self): self.actionDockWidget.setChecked(True) else: self.actionDockWidget.setChecked(False) - - diff --git a/python/plugins/osm/OsmSaveDlg.py b/python/plugins/osm/OsmSaveDlg.py index 76750a3532db..0ffaa7d7f26f 100755 --- a/python/plugins/osm/OsmSaveDlg.py +++ b/python/plugins/osm/OsmSaveDlg.py @@ -79,7 +79,7 @@ def showSaveFileDialog(self): lastDir = settings.value("/OSM_Plugin/lastDir", QVariant(QString())).toString() # display file open dialog and get absolute path to selected file - fileSelected = QFileDialog.getSaveFileName(self,"Choose an Open Street Map file",lastDir,"OSM Files (*.osm)"); + fileSelected = QFileDialog.getSaveFileName(self, self.tr("Choose an Open Street Map file"),lastDir,self.tr("OSM Files (*.osm)") ); # insert OSM file path into line edit control if not fileSelected.isNull(): self.OSMFileEdit.setText(fileSelected) @@ -457,6 +457,3 @@ def onOK(self): if self.outFile and self.outFile.exists(): self.outFile.close() self.close() - - - diff --git a/python/plugins/osm/OsmUndoRedoDW.py b/python/plugins/osm/OsmUndoRedoDW.py index fbf7efe5c72e..4cb0799439a7 100755 --- a/python/plugins/osm/OsmUndoRedoDW.py +++ b/python/plugins/osm/OsmUndoRedoDW.py @@ -437,5 +437,3 @@ def redo(self,standAlone=True): if self.redoCounter>0: self.redoButton.setEnabled(True) self.plugin.dockWidget.redoButton.setEnabled(True) - - diff --git a/python/plugins/osm/OsmUploadDlg.py b/python/plugins/osm/OsmUploadDlg.py index df1055e81381..c85148f58b99 100755 --- a/python/plugins/osm/OsmUploadDlg.py +++ b/python/plugins/osm/OsmUploadDlg.py @@ -56,7 +56,7 @@ def __init__(self,plugin): self.ur=plugin.undoredo self.urlHost = "api.openstreetmap.org" - self.uploadButton = self.buttonBox.addButton("Upload", QDialogButtonBox.ActionRole) + self.uploadButton = self.buttonBox.addButton(self.tr("Upload"), QDialogButtonBox.ActionRole) self.uploadChangesTable.setColumnCount(5) self.uploadChangesTable.setColumnWidth(0,80) @@ -1079,7 +1079,7 @@ def __httpNodeAdditionReqFinished(self, requestId, error): del self.pseudoId_map[requestId] if error: - self.cancelUpload("Node addition failed.") + self.cancelUpload( self.tr("Node addition failed.") ) return newNodeIdStr=QString(self.http.readAll().data()) @@ -1119,7 +1119,7 @@ def __httpNodeUpdateReqFinished(self, requestId, error): del self.featureId_map[requestId] if error: - self.cancelUpload("Node update failed.") + self.cancelUpload(self.tr("Node update failed.")) return newVersionIdStr=QString(self.http.readAll().data()) @@ -1158,7 +1158,7 @@ def __httpNodeDeletionReqFinished(self, requestId, error): del self.featureId_map[requestId] if error: - self.cancelUpload("Node deletion failed.") + self.cancelUpload(self.tr("Node deletion failed.")) return self.dbm.removePointRecord(pointId) @@ -1194,7 +1194,7 @@ def __httpWayAdditionReqFinished(self, requestId, error): del self.pseudoId_map[requestId] if error: - self.cancelUpload("Way addition failed.") + self.cancelUpload(self.tr("Way addition failed.")) return newWayIdStr = QString(self.http.readAll().data()) @@ -1234,7 +1234,7 @@ def __httpWayUpdateReqFinished(self, requestId, error): del self.featureId_map[requestId] if error: - self.cancelUpload("Way update failed.") + self.cancelUpload(self.tr("Way update failed.")) return newVersionIdStr=QString(self.http.readAll().data()) @@ -1273,7 +1273,7 @@ def __httpWayDeletionReqFinished(self, requestId, error): del self.featureId_map[requestId] if error: - self.cancelUpload("Way deletion failed.") + self.cancelUpload(self.tr("Way deletion failed.")) return self.dbm.removeWayRecord(wayId) @@ -1309,7 +1309,7 @@ def __httpRelationAdditionReqFinished(self, requestId, error): del self.pseudoId_map[requestId] if error: - self.cancelUpload("Relation addition failed.") + self.cancelUpload(self.tr("Relation addition failed.")) return newRelIdStr=QString(self.http.readAll().data()) @@ -1348,7 +1348,7 @@ def __httpRelationUpdateReqFinished(self, requestId, error): del self.featureId_map[requestId] if error: - self.cancelUpload("Relation update failed.") + self.cancelUpload(self.tr("Relation update failed.")) return newVersionIdStr=QString(self.http.readAll().data()) @@ -1386,7 +1386,7 @@ def __httpRelationDeletionReqFinished(self, requestId, error): del self.featureId_map[requestId] if error: - self.cancelUpload("Relation deletion failed.") + self.cancelUpload(self.tr("Relation deletion failed.")) return self.dbm.removeRelationRecord(relId) @@ -1417,7 +1417,7 @@ def __httpChangesetCreationReqFinished(self, requestId, error): self.disconnect(self.http, SIGNAL("requestFinished(int, bool)"), self.__httpChangesetCreationReqFinished) if error: - self.cancelUpload("Connection to OpenStreetMap server cannot be established. Please check your proxy settings, firewall settings and try again.") + self.cancelUpload(self.tr("Connection to OpenStreetMap server cannot be established. Please check your proxy settings, firewall settings and try again.")) return del self.qhttp_map[requestId] @@ -1448,7 +1448,7 @@ def __httpChangesetClosingReqFinished(self, requestId, error): self.disconnect(self.http, SIGNAL("requestFinished(int, bool)"), self.__httpChangesetClosingReqFinished) if error: - self.cancelUpload("Changeset closing failed.") + self.cancelUpload(self.tr("Changeset closing failed.")) return # call the next upload step @@ -1468,7 +1468,7 @@ def __readResponseHeader(self, responseHeader): if responseHeader.statusCode() != 200: - self.cancelUpload(QString("Upload process failed. OpenStreetMap server response: %1 - %2.") + self.cancelUpload(self.tr("Upload process failed. OpenStreetMap server response: %1 - %2.") .arg(responseHeader.reasonPhrase()) .arg(responseHeader.value("Error"))) @@ -1480,7 +1480,7 @@ def __authRequired(self,s,a,b): We are really not interested in function parameters - we just cancel the connection. """ - self.cancelUpload("Authentication failed. Please try again with correct login and password.") + self.cancelUpload(self.tr("Authentication failed. Please try again with correct login and password.")) def __setProxy(self): @@ -1536,13 +1536,13 @@ def __examineResponse(self,requestId,error): return if requestId==self.reqSetHost: - self.cancelUpload("Setting host failed.") + self.cancelUpload(self.tr("Setting host failed.")) elif requestId==self.reqSetUser: - self.cancelUpload("Setting user and password failed.") + self.cancelUpload(self.tr("Setting user and password failed.")) elif requestId==self.reqSetProxy: - self.cancelUpload("Setting proxy failed.") + self.cancelUpload(self.tr("Setting proxy failed."))