@@ -73,28 +73,28 @@ def initGui(self):
73
73
74
74
# create action for loading OSM file
75
75
self .actionLoad = QAction (QIcon (":/plugins/osm_plugin/images/osm_load.png" )
76
- ," Load OSM from file" , self .iface .mainWindow ())
77
- self .actionLoad .setWhatsThis (" Load OpenStreetMap from file" )
76
+ ,QCoreApplication . translate ( "OsmPlugin" , " Load OSM from file") , self .iface .mainWindow ())
77
+ self .actionLoad .setWhatsThis ( QCoreApplication . translate ( "OsmPlugin" , " Load OpenStreetMap from file") )
78
78
# create action for import of a layer into OSM
79
79
self .actionImport = QAction (QIcon (":/plugins/osm_plugin/images/osm_import.png" )
80
- ," Import data from a layer" , self .iface .mainWindow ())
81
- self .actionImport .setWhatsThis (" Import data from a layer to OpenStreetMap" )
80
+ ,QCoreApplication . translate ( "OsmPlugin" , " Import data from a layer") , self .iface .mainWindow ())
81
+ self .actionImport .setWhatsThis (QCoreApplication . translate ( "OsmPlugin" , " Import data from a layer to OpenStreetMap") )
82
82
# create action for saving OSM file
83
83
self .actionSave = QAction (QIcon (":/plugins/osm_plugin/images/osm_save.png" )
84
- ," Save OSM to file" , self .iface .mainWindow ())
85
- self .actionSave .setWhatsThis (" Save OpenStreetMap to file" )
84
+ ,QCoreApplication . translate ( "OsmPlugin" , " Save OSM to file") , self .iface .mainWindow ())
85
+ self .actionSave .setWhatsThis (QCoreApplication . translate ( "OsmPlugin" , " Save OpenStreetMap to file") )
86
86
# create action for OSM data downloading
87
87
self .actionDownload = QAction (QIcon (":/plugins/osm_plugin/images/osm_download.png" )
88
- ," Download OSM data" , self .iface .mainWindow ())
89
- self .actionDownload .setWhatsThis (" Download OpenStreetMap data" )
88
+ ,QCoreApplication . translate ( "OsmPlugin" , " Download OSM data") , self .iface .mainWindow ())
89
+ self .actionDownload .setWhatsThis (QCoreApplication . translate ( "OsmPlugin" , " Download OpenStreetMap data") )
90
90
# create action for OSM data downloading
91
91
self .actionUpload = QAction (QIcon (":/plugins/osm_plugin/images/osm_upload.png" )
92
- ," Upload OSM data" , self .iface .mainWindow ())
93
- self .actionUpload .setWhatsThis (" Upload OpenStreetMap data" )
92
+ ,QCoreApplication . translate ( "OsmPlugin" , " Upload OSM data") , self .iface .mainWindow ())
93
+ self .actionUpload .setWhatsThis (QCoreApplication . translate ( "OsmPlugin" , " Upload OpenStreetMap data") )
94
94
# create action for OSM dockable window
95
95
self .actionDockWidget = QAction (QIcon (":/plugins/osm_plugin/images/osm_featureManager.png" )
96
- ," Show/Hide OSM Feature Manager" ,self .iface .mainWindow ())
97
- self .actionDockWidget .setWhatsThis (" Show/Hide OpenStreetMap Feature Manager" )
96
+ ,QCoreApplication . translate ( "OsmPlugin" , " Show/Hide OSM Feature Manager") ,self .iface .mainWindow ())
97
+ self .actionDockWidget .setWhatsThis (QCoreApplication . translate ( "OsmPlugin" , " Show/Hide OpenStreetMap Feature Manager") )
98
98
self .actionDockWidget .setCheckable (True )
99
99
100
100
# connect new action to plugin function - when action is triggered
@@ -193,7 +193,8 @@ def loadOsmFromFile(self):
193
193
194
194
# sanity check whether we're able to load osm data
195
195
if 'osm' not in QgsProviderRegistry .instance ().providerList ():
196
- QMessageBox .critical (None , "Sorry" , "You don't have OSM provider installed!" )
196
+ QMessageBox .critical (None , QCoreApplication .translate ( "OsmPlugin" , "Sorry" ),
197
+ QCoreApplication .translate ( "OsmPlugin" , "You don't have OSM provider installed!" ) )
197
198
return
198
199
199
200
# show modal dialog with OSM file selection
@@ -222,13 +223,14 @@ def saveOsmToFile(self):
222
223
"""
223
224
224
225
if 'osm' not in QgsProviderRegistry .instance ().providerList ():
225
- QMessageBox .critical (None , "Sorry" , "You don't have OSM provider installed!" )
226
+ QMessageBox .critical (None , QCoreApplication .translate ( "OsmPlugin" , "Sorry" ),
227
+ QCoreApplication .translate ( "OsmPlugin" , "You don't have OSM provider installed!" ) )
226
228
return
227
229
228
230
if not self .dbm .currentKey :
229
- QMessageBox .information (QWidget (), QString ( " OSM Save to file" )
230
- , "No OSM data are loaded/downloaded or no OSM layer is selected in Layers panel. \
231
- Please change this situation first, because OSM Plugin doesn't know what to save." )
231
+ QMessageBox .information (QWidget (), QCoreApplication . translate ( "OsmPlugin" , " OSM Save to file" ),
232
+ QCoreApplication . translate ( "OsmPlugin" , "No OSM data are loaded/downloaded or no OSM layer is selected in Layers panel. \
233
+ Please change this situation first, because OSM Plugin doesn't know what to save." ) )
232
234
return
233
235
234
236
# show modal dialog with OSM file selection
@@ -247,7 +249,8 @@ def downloadOsmData(self):
247
249
"""
248
250
249
251
if 'osm' not in QgsProviderRegistry .instance ().providerList ():
250
- QMessageBox .critical (None , "Sorry" , "You don't have OSM provider installed!" )
252
+ QMessageBox .critical (None , QCoreApplication .translate ( "OsmPlugin" , "Sorry" ),
253
+ QCoreApplication .translate ( "OsmPlugin" , "You don't have OSM provider installed!" ) )
251
254
return
252
255
253
256
self .dlgDownload = OsmDownloadDlg (self )
@@ -299,9 +302,9 @@ def uploadOsmData(self):
299
302
300
303
# first check if there are some data; if not upload doesn't have sense
301
304
if not self .dbm .currentKey :
302
- QMessageBox .information (QWidget (), QString ( " OSM Upload" )
303
- , "No OSM data are loaded/downloaded or no OSM layer is selected in Layers panel. \
304
- Please change this situation first, because OSM Plugin doesn't know what to upload." )
305
+ QMessageBox .information (QWidget (), QCoreApplication . translate ( "OsmPlugin" , " OSM Upload" ),
306
+ QCoreApplication . translate ( "OsmPlugin" , "No OSM data are loaded/downloaded or no OSM layer is selected in Layers panel. \
307
+ Please change this situation first, because OSM Plugin doesn't know what to upload." ) )
305
308
return
306
309
307
310
self .dlgUpload = OsmUploadDlg (self )
@@ -316,18 +319,20 @@ def importData(self):
316
319
"""
317
320
318
321
if 'osm' not in QgsProviderRegistry .instance ().providerList ():
319
- QMessageBox .critical (None , "Sorry" , "You don't have OSM provider installed!" )
322
+ QMessageBox .critical (None , QCoreApplication .translate ( "OsmPlugin" , "Sorry" ),
323
+ QCoreApplication .translate ( "OsmPlugin" , "You don't have OSM provider installed!" ) )
320
324
return
321
325
322
326
if self .dbm .currentKey is None :
323
- QMessageBox .information (self .iface .mainWindow (), " OSM Import"
324
- , "No OSM data are loaded/downloaded or no OSM layer is selected in Layers panel. \
325
- Please change this situation first, because OSM Plugin doesn't know what layer will be destination of the import." )
327
+ QMessageBox .information (self .iface .mainWindow (), QCoreApplication . translate ( "OsmPlugin" , " OSM Import"),
328
+ QCoreApplication . translate ( "OsmPlugin" , "No OSM data are loaded/downloaded or no OSM layer is selected in Layers panel. \
329
+ Please change this situation first, because OSM Plugin doesn't know what layer will be destination of the import." ) )
326
330
return
327
331
328
332
dlg = OsmImportDlg (self )
329
333
if dlg .cboLayer .count ()== 0 :
330
- QMessageBox .information (self .iface .mainWindow (), "OSM Import" , "There are currently no available vector layers." )
334
+ QMessageBox .information (self .iface .mainWindow (), QCoreApplication .translate ( "OsmPlugin" , "OSM Import" ),
335
+ QCoreApplication .translate ( "OsmPlugin" , "There are currently no available vector layers." ) )
331
336
return
332
337
333
338
dlg .exec_ ()
@@ -367,5 +372,3 @@ def __ofVisibilityChanged(self):
367
372
self .actionDockWidget .setChecked (True )
368
373
else :
369
374
self .actionDockWidget .setChecked (False )
370
-
371
-
0 commit comments