make default added jid translatable in jid-multi field of a dataform

This commit is contained in:
Yann Leboulanger 2007-11-12 21:32:23 +00:00
parent 227c811b82
commit 5febd11788
1 changed files with 4 additions and 3 deletions

View File

@ -537,12 +537,13 @@ class SingleForm(gtk.Table, object):
field.values = values
def on_jid_multi_add_button_clicked(self, widget, treeview, model, field):
jid = 'new@jabber.id'
#Default jid
jid = _('new@jabber.id')
if jid in field.values:
i = 1
while 'new%d@jabber.id' % i in field.values:
while _('new%d@jabber.id') % i in field.values:
i += 1
jid = 'new%d@jabber.id' % i
jid = _('new%d@jabber.id') % i
iter = model.insert(999999, (jid,))
treeview.set_cursor(model.get_path(iter), treeview.get_column(0), True)
field.values = field.values + [jid]