Skip to content

Commit

Permalink
metasearch: fix some self.tr calls
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jun 20, 2014
1 parent 614c1b2 commit ef0e7d0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
26 changes: 13 additions & 13 deletions python/plugins/MetaSearch/dialogs/maindialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def delete_connection(self):

key = '/MetaSearch/%s' % current_text

msg = self.tr('Remove service %s?' % current_text)
msg = self.tr('Remove service %s?') % current_text

result = QMessageBox.information(self, self.tr('Confirm delete'), msg,
QMessageBox.Ok | QMessageBox.Cancel)
Expand Down Expand Up @@ -335,7 +335,7 @@ def add_default_connections(self):
name = server.attrib.get('name')
# check for duplicates
if name in keys:
msg = self.tr('%s exists. Overwrite?' % name)
msg = self.tr('%s exists. Overwrite?') % name
res = QMessageBox.warning(self,
self.tr('Loading connections'), msg,
QMessageBox.Yes | QMessageBox.No)
Expand Down Expand Up @@ -463,12 +463,12 @@ def search(self):
except ExceptionReport, err:
QApplication.restoreOverrideCursor()
QMessageBox.warning(self, self.tr('Search error'),
self.tr('Search error: %s' % err))
self.tr('Search error: %s') % err)
return
except Exception, err:
QApplication.restoreOverrideCursor()
QMessageBox.warning(self, self.tr('Connection error'),
self.tr('Connection error: %s' % err))
self.tr('Connection error: %s') % err)
return

if self.catalog.results['matches'] == 0:
Expand All @@ -486,10 +486,10 @@ def display_results(self):

position = self.catalog.results['returned'] + self.startfrom

msg = self.tr('Showing %d - %d of %d result%s' %
(self.startfrom + 1, position,
msg = self.tr('Showing %d - %d of %d result%s') % (
self.startfrom + 1, position,
self.catalog.results['matches'],
's'[self.catalog.results['matches'] == 1:]))
's'[self.catalog.results['matches'] == 1:])

self.lblResults.setText(msg)

Expand Down Expand Up @@ -687,7 +687,7 @@ def add_to_ows(self):
ows = WebCoverageService(data_url, '1.0.0')
except Exception, err:
QApplication.restoreOverrideCursor()
msg = self.tr('Error connecting to %s: %s' % (stype[0], err))
msg = self.tr('Error connecting to %s: %s') % (stype[0], err)
QMessageBox.warning(self, self.tr('Connection error'), msg)
return

Expand All @@ -710,7 +710,7 @@ def add_to_ows(self):

# check for duplicates
if sname in keys and self.radioTitleAsk.isChecked():
msg = self.tr('Connection %s exists. Overwrite?' % sname)
msg = self.tr('Connection %s exists. Overwrite?') % sname
res = QMessageBox.warning(self, self.tr('Saving server'), msg,
QMessageBox.Yes | QMessageBox.No)
if res != QMessageBox.Yes:
Expand Down Expand Up @@ -779,7 +779,7 @@ def show_metadata(self):
except ExceptionReport, err:
QApplication.restoreOverrideCursor()
QMessageBox.warning(self, self.tr('GetRecords error'),
self.tr('Error getting response: %s' % err))
self.tr('Error getting response: %s') % err)
return

QApplication.restoreOverrideCursor()
Expand Down Expand Up @@ -848,11 +848,11 @@ def _get_csw(self):
self.catalog = CatalogueServiceWeb(self.catalog_url)
return True
except ExceptionReport, err:
msg = self.tr('Error connecting to service: %s' % err)
msg = self.tr('Error connecting to service: %s') % err
except ValueError, err:
msg = self.tr('Value Error: %s' % err)
msg = self.tr('Value Error: %s') % err
except Exception, err:
msg = self.tr('Unknown Error: %s' % err)
msg = self.tr('Unknown Error: %s') % err

QMessageBox.warning(self, self.tr('CSW Connection error'), msg)
QApplication.restoreOverrideCursor()
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/MetaSearch/dialogs/manageconnectionsdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def save(self, connections):
with open(self.filename, 'w') as fileobj:
fileobj.write(prettify_xml(etree.tostring(doc)))
QMessageBox.information(self, self.tr('Save Connections'),
self.tr('Saved to %s' % self.filename))
self.tr('Saved to %s') % self.filename)
self.reject()

def load(self, items):
Expand All @@ -153,7 +153,7 @@ def load(self, items):

# check for duplicates
if conn_name in keys:
label = self.tr('File %s exists. Overwrite?' % conn_name)
label = self.tr('File %s exists. Overwrite?') % conn_name
res = QMessageBox.warning(self, self.tr('Loading Connections'),
label,
QMessageBox.Yes | QMessageBox.No)
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/MetaSearch/dialogs/newconnectiondialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def accept(self):
if all([self.conn_name_orig != conn_name,
self.settings.contains(keyurl)]):
res = QMessageBox.warning(self, self.tr('Save connection'),
self.tr('Overwrite %s?' % conn_name),
self.tr('Overwrite %s?') % conn_name,
QMessageBox.Ok | QMessageBox.Cancel)
if res == QMessageBox.Cancel:
return
Expand Down

0 comments on commit ef0e7d0

Please sign in to comment.