l10n: add missing gettextifications in GuiDatabase

This commit is contained in:
steffen123 2010-08-30 01:19:23 +02:00
parent f52e311632
commit 1f2c320fd2

View File

@ -403,8 +403,7 @@ class GuiDatabase:
status = "failed"
icon = gtk.STOCK_CANCEL
if err_msg:
log.info( _('db connection to ') + str(dbms_num)+','+host+','+name+','+user+','+passwd+' failed: '
+ err_msg )
log.info( _('db connection to %s, %s, %s, %s, %s failed: %s') % (str(dbms_num), host, name, user, passwd, err_msg))
return( status, err_msg, icon )
@ -412,7 +411,7 @@ class GuiDatabase:
class AddDB(gtk.Dialog):
def __init__(self, config, parent):
log.debug("AddDB starting")
log.debug(_("AddDB starting"))
self.dbnames = { 'Sqlite' : Configuration.DATABASE_TYPE_SQLITE
, 'MySQL' : Configuration.DATABASE_TYPE_MYSQL
, 'PostgreSQL' : Configuration.DATABASE_TYPE_POSTGRESQL
@ -421,7 +420,7 @@ class AddDB(gtk.Dialog):
# create dialog and add icon and label
super(AddDB,self).__init__( parent=parent
, flags=gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT
, title="Add New Database"
, title=_("Add New Database")
, buttons = (gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT
,gtk.STOCK_SAVE, gtk.RESPONSE_ACCEPT)
) # , buttons=btns
@ -489,7 +488,7 @@ class AddDB(gtk.Dialog):
def run(self):
response = super(AddDB,self).run()
log.debug("adddb.run: response is "+str(response)+" accept is "+str(int(gtk.RESPONSE_ACCEPT)))
log.debug(_("addDB.run: response is %s accept is %s" % (str(response), str(int(gtk.RESPONSE_ACCEPT)))))
ok,retry = False,True
while response == gtk.RESPONSE_ACCEPT:
@ -503,7 +502,7 @@ class AddDB(gtk.Dialog):
,name, db_desc, user, passwd, host) = ("error", "error", None, None, None
,None, None, None, None, None)
if ok:
log.debug("start creating new db")
log.debug(_("start creating new db"))
# add a new db
master_password = None
dbms = self.dbnames[ self.cb_dbms.get_active_text() ]
@ -522,7 +521,7 @@ class AddDB(gtk.Dialog):
# test db after creating?
status, err_msg, icon = GuiDatabase.testDB(self.config, dbms, dbms_num, name, user, passwd, host)
log.debug('tested new db, result='+str((status,err_msg)))
log.debug(_('tested new db, result=%s') % str((status,err_msg)))
if status == 'ok':
#dia = InfoBox( parent=self, str1=_('Database created') )
str1 = _('Database created')
@ -541,7 +540,7 @@ class AddDB(gtk.Dialog):
"""check fields and return true/false according to whether user wants to try again
return False if fields are ok
"""
log.debug("check_fields: starting")
log.debug(_("check_fields: starting"))
try_again = False
ok = True
@ -573,11 +572,11 @@ class AddDB(gtk.Dialog):
# checks for postgres
pass
else:
msg = "Unknown Database Type selected"
msg = _("Unknown Database Type selected")
ok = False
if not ok:
log.debug("check_fields: open dialog")
log.debug(_("check_fields: open dialog"))
dia = gtk.MessageDialog( parent=self
, flags=gtk.DIALOG_DESTROY_WITH_PARENT
, type=gtk.MESSAGE_ERROR
@ -590,14 +589,14 @@ class AddDB(gtk.Dialog):
dia.vbox.add(l)
dia.show_all()
ret = dia.run()
log.debug("check_fields: ret is "+str(ret)+" cancel is "+str(int(gtk.RESPONSE_CANCEL)))
log.debug(_("check_fields: ret is %s cancel is %s" % (str(ret), str(int(gtk.RESPONSE_CANCEL)))))
if ret == gtk.RESPONSE_YES:
try_again = True
log.debug("check_fields: destroy dialog")
log.debug(_("check_fields: destroy dialog"))
dia.hide()
dia.destroy()
log.debug("check_fields: returning ok as "+str(ok)+", try_again as "+str(try_again))
log.debug(_("check_fields: returning ok as %s, try_again as %s") % (str(ok), str(try_again)))
return(ok,try_again)
def db_type_changed(self, widget, data):