From 3990b40e3db7023a6c1f027ae19fd527165de343 Mon Sep 17 00:00:00 2001 From: steffen123 Date: Sun, 29 Aug 2010 20:35:16 +0200 Subject: [PATCH] Some string changes, mostly consistency to make translation easier --- pyfpdb/Filters.py | 6 +++--- pyfpdb/GuiBulkImport.py | 2 +- pyfpdb/GuiDatabase.py | 12 +++++++----- pyfpdb/fpdb.pyw | 5 +++-- pyfpdb/fpdb_import.py | 8 ++++---- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/pyfpdb/Filters.py b/pyfpdb/Filters.py index 4bbc6057..136c0ab6 100644 --- a/pyfpdb/Filters.py +++ b/pyfpdb/Filters.py @@ -63,7 +63,7 @@ class Filters(threading.Thread): ,'seatsbetween':_('Between:'), 'seatsand':_('And:'), 'seatsshow':_('Show Number of _Players') ,'playerstitle':_('Hero:'), 'sitestitle':_('Sites:'), 'gamestitle':_('Games:') ,'limitstitle':_('Limits:'), 'seatstitle':_('Number of Players:') - ,'groupstitle':_('Grouping:'), 'posnshow':_('Show Position Stats:') + ,'groupstitle':_('Grouping:'), 'posnshow':_('Show Position Stats') ,'datestitle':_('Date:') ,'groupsall':_('All Players') ,'limitsFL':'FL', 'limitsNL':'NL', 'limitsPL':'PL', 'ring':_('Ring'), 'tour':_('Tourney') @@ -891,7 +891,7 @@ class Filters(threading.Thread): hbox = gtk.HBox() vbox1.pack_start(hbox, False, True, 0) - lbl_start = gtk.Label('From:') + lbl_start = gtk.Label(_('From:')) btn_start = gtk.Button() btn_start.set_image(gtk.image_new_from_stock(gtk.STOCK_INDEX, gtk.ICON_SIZE_BUTTON)) @@ -905,7 +905,7 @@ class Filters(threading.Thread): hbox = gtk.HBox() vbox1.pack_start(hbox, False, True, 0) - lbl_end = gtk.Label(' To:') + lbl_end = gtk.Label(_('To:')) btn_end = gtk.Button() btn_end.set_image(gtk.image_new_from_stock(gtk.STOCK_INDEX, gtk.ICON_SIZE_BUTTON)) btn_end.connect('clicked', self.__calendar_dialog, self.end_date) diff --git a/pyfpdb/GuiBulkImport.py b/pyfpdb/GuiBulkImport.py index 943a81fd..a90f566c 100755 --- a/pyfpdb/GuiBulkImport.py +++ b/pyfpdb/GuiBulkImport.py @@ -136,7 +136,7 @@ class GuiBulkImport(): #self.settings['global_lock'].release() self.settings['global_lock'].release() else: - print _("bulk-import aborted - global lock not available") + print _("bulk import aborted - global lock not available") def get_vbox(self): """returns the vbox of this thread""" diff --git a/pyfpdb/GuiDatabase.py b/pyfpdb/GuiDatabase.py index 599f0a7e..e85e3057 100755 --- a/pyfpdb/GuiDatabase.py +++ b/pyfpdb/GuiDatabase.py @@ -300,7 +300,7 @@ class GuiDatabase: self.dia.show() except: err = traceback.extract_tb(sys.exc_info()[2])[-1] - print _('loaddbs error: ')+str(dbms_num)+','+host+','+name+','+user+','+passwd+' failed: ' \ + print _('loadDbs error: ')+str(dbms_num)+','+host+','+name+','+user+','+passwd+' failed: ' \ + err[2] + "(" + str(err[1]) + "): " + str(sys.exc_info()[1]) def sortCols(self, col, n): @@ -368,7 +368,7 @@ class GuiDatabase: try: # is creating empty db for sqlite ... mod db.py further? # add noDbTables flag to db.py? - log.debug(_("loaddbs: trying to connect to: %s/%s, %s, %s/%s") % (str(dbms_num),dbms,name,user,passwd)) + log.debug(_("testDB: trying to connect to: %s/%s, %s, %s/%s") % (str(dbms_num),dbms,name,user,passwd)) db.connect(backend=dbms_num, host=host, database=name, user=user, password=passwd, create=False) if db.connected: log.debug(_(" connected ok")) @@ -384,14 +384,16 @@ class GuiDatabase: status = "failed" icon = gtk.STOCK_CANCEL except Exceptions.FpdbMySQLNoDatabase: - err_msg = _("MySQL client reports: 2002 or 2003 error. Unable to connect - Please check that the MySQL service has been started") + err_msg = _("MySQL client reports: 2002 or 2003 error. Unable to connect - ") \ + + _("Please check that the MySQL service has been started") status = "failed" icon = gtk.STOCK_CANCEL except Exceptions.FpdbPostgresqlAccessDenied: - err_msg = _("Postgres Server reports: Access denied. Are your permissions set correctly?") + err_msg = _("PostgreSQL Server reports: Access denied. Are your permissions set correctly?") status = "failed" except Exceptions.FpdbPostgresqlNoDatabase: - err_msg = _("Postgres client reports: Unable to connect - Please check that the Postgres service has been started") + err_msg = _("PostgreSQL client reports: Unable to connect - ") \ + + _("Please check that the PostgreSQL service has been started") status = "failed" icon = gtk.STOCK_CANCEL except: diff --git a/pyfpdb/fpdb.pyw b/pyfpdb/fpdb.pyw index d6cf4015..0cfe49ed 100755 --- a/pyfpdb/fpdb.pyw +++ b/pyfpdb/fpdb.pyw @@ -544,8 +544,9 @@ class fpdb: #lock_released = False dia_confirm = gtk.MessageDialog(parent=self.window, flags=gtk.DIALOG_DESTROY_WITH_PARENT, type=gtk.MESSAGE_WARNING, buttons=(gtk.BUTTONS_YES_NO), message_format=_("Confirm deleting and recreating tables")) - diastring = _("Please confirm that you want to (re-)create the tables. If there already are tables in the database ") \ - +self.db.database+" on "+self.db.host+_(" they will be deleted and you will have to re-import your histories.\nThis may take a while.") + diastring = _("Please confirm that you want to (re-)create the tables.") \ + + (_(" If there already are tables in the database %s on %s they will be deleted and you will have to re-import your histories.\n") % (self.db.database, self.db.host)) \ + + _("This may take a while.") dia_confirm.format_secondary_text(diastring)#todo: make above string with bold for db, host and deleted # disable windowclose, do not want the the underlying processing interrupted mid-process dia_confirm.set_deletable(False) diff --git a/pyfpdb/fpdb_import.py b/pyfpdb/fpdb_import.py index 8ff2ba86..39550a17 100755 --- a/pyfpdb/fpdb_import.py +++ b/pyfpdb/fpdb_import.py @@ -224,7 +224,7 @@ class Importer: #print " adding file ", file self.addImportFile(os.path.join(dir, file), site, filter) else: - log.warning(_("Attempted to add non-directory: '%s' as an import directory") % str(dir)) + log.warning(_("Attempted to add non-directory '%s' as an import directory") % str(dir)) def runImport(self): """"Run full import on self.filelist. This is called from GuiBulkImport.py""" @@ -310,7 +310,7 @@ class Importer: toterrors += errors for i in xrange( self.settings['threads'] ): - print _("sending finish msg qlen ="), q.qsize() + print _("sending finish message queue length ="), q.qsize() db.send_finish_msg(q) return (totstored, totdups, totpartial, toterrors) @@ -436,9 +436,9 @@ class Importer: # Load filter, process file, pass returned filename to import_fpdb_file if self.settings['threads'] > 0 and self.writeq is not None: - log.info(_("Converting ") + file + " (" + str(q.qsize()) + ")") + log.info((_("Converting %s") % file) + " (" + str(q.qsize()) + ")") else: - log.info(_("Converting ") + file) + log.info(_("Converting %s") % file) hhbase = self.config.get_import_parameters().get("hhArchiveBase") hhbase = os.path.expanduser(hhbase) hhdir = os.path.join(hhbase,site)