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