Commit 7e5192c8 authored by Dicson's avatar Dicson

gotr. prevent gettext warnings

parent 4b37c0c5
......@@ -110,13 +110,15 @@ class GajimContext(potr.context.Context):
trust = self.getCurrentTrust()
if trust is None:
fpr = str(self.getCurrentKey())
OtrPlugin.gajim_log(_('New fingerprint for %s: %s')
% (self.peer, fpr), self.user.accountname, self.peer)
OtrPlugin.gajim_log(_('New fingerprint for %(peer)s: %(fpr)s')
% {'peer': self.peer, 'fpr': fpr},
self.user.accountname, self.peer)
trustStr = 'authenticated' if bool(trust) else '*unauthenticated*'
_('%s secured OTR conversation with %s started')
% (trustStr, self.peer), self.user.accountname, self.peer)
_('%(trustStr)s secured OTR conversation with %(peer)s started')
% {'trustStr': trustStr, 'peer': self.peer},
self.user.accountname, self.peer)
if self.state != potr.context.STATE_PLAINTEXT and \
newstate == potr.context.STATE_PLAINTEXT:
......@@ -458,8 +460,9 @@ class OtrPlugin(GajimPlugin):
except potr.context.UnencryptedMessage, e:
tlvs = []
msgtxt = _('The following message received from %s was '
'*not encrypted*: [%s]') % (event.fjid, e.args[0])
msgtxt = _('The following message received from %(jid)s was '
'*not encrypted*: [%(error)s]') % {'jid': event.fjid,
'error': e.args[0]}
except potr.context.NotEncryptedError, e:
self.gajim_log(_('The encrypted message received from %s is '
'unreadable, as you are not currently communicating '
......@@ -467,12 +470,13 @@ class OtrPlugin(GajimPlugin):
return IGNORE
except potr.context.ErrorReceived, e:
self.gajim_log(_('We received the following OTR error '
'message from %s: [%s]') % (event.fjid, e.args[0].error),
account, event.fjid)
'message from %(jid)s: [%(error)s]') % {'jid': event.fjid,
'error': e.args[0].error}
return IGNORE
except RuntimeError, e:
self.gajim_log(_('The following error occurred when trying to '
'decrypt a message from %s: [%s]') % (event.fjid, e),
'decrypt a message from %(jid)s: [%(error)s]') % {
'jid': event.fjid, 'error': e},
account, event.fjid)
return IGNORE
event.msgtxt = unicode(msgtxt)
......@@ -188,8 +188,8 @@ from common import gajim
our_fp_text = _('Your fingerprint:\n' \
'<span weight="bold" face="monospace">%s</span>')
their_fp_text = _('Purported fingerprint for %s:\n' \
'<span weight="bold" face="monospace">%s</span>')
their_fp_text = _('Purported fingerprint for %(jid)s:\n' \
'<span weight="bold" face="monospace">%(fp)s</span>')
another_q = _('You may want to authenticate your buddy as well by asking'\
'your own question.')
......@@ -434,8 +434,8 @@ class ContactOtrWindow(gtk.Dialog):
for widget in'otr_fp_vbox').get_children():
# show that the fingerprint is unknown'their_fp_label').set_markup(their_fp_text % (self.fjid,
_('unknown')))'their_fp_label').set_markup(their_fp_text % {
'jid': self.fjid, 'fp': _('unknown')})'verified_combobox').set_active(-1)
# make the fingerprint widgets sensitive when encrypted
......@@ -443,7 +443,8 @@ class ContactOtrWindow(gtk.Dialog):
# show their fingerprint
fp = potr.human_hash(self.fpr)'their_fp_label').set_markup(their_fp_text%(self.fjid, fp))'their_fp_label').set_markup(their_fp_text % {
'jid': self.fjid, 'fp': fp})
# set the trust combobox
if ctx.getCurrentTrust():'verified_combobox').set_active(1)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment