[omemo] Make some strings translatable

This commit is contained in:
Daniel
2017-12-21 22:22:49 +01:00
parent 5e31aefe27
commit 042c491a41
3 changed files with 20 additions and 20 deletions

View File

@@ -144,8 +144,8 @@ class FileDecryption:
file.filepath = os.path.join(DIRECTORY, newfilename) file.filepath = os.path.join(DIRECTORY, newfilename)
def finished(self, file): def finished(self, file):
question = 'Do you want to open %s' % file.filename question = _('Do you want to open %s') % file.filename
YesNoDialog('Open File', question, YesNoDialog(_('Open File'), question,
transient_for=self.window, transient_for=self.window,
on_response_yes=(self.open_file, file.filepath)) on_response_yes=(self.open_file, file.filepath))
return False return False
@@ -169,18 +169,18 @@ class Download:
self.download() self.download()
def download(self): def download(self):
GLib.idle_add(self.progressbar.set_text, 'Downloading...') GLib.idle_add(self.progressbar.set_text, _('Downloading...'))
data = self.load_url() data = self.load_url()
if isinstance(data, str): if isinstance(data, str):
GLib.idle_add(self.progressbar.close_dialog) GLib.idle_add(self.progressbar.close_dialog)
GLib.idle_add(self.error, data) GLib.idle_add(self.error, data)
return return
GLib.idle_add(self.progressbar.set_text, 'Decrypting...') GLib.idle_add(self.progressbar.set_text, _('Decrypting...'))
decrypted_data = self.aes_decrypt(data) decrypted_data = self.aes_decrypt(data)
GLib.idle_add( GLib.idle_add(
self.progressbar.set_text, 'Writing file to harddisk...') self.progressbar.set_text, _('Writing file to harddisk...'))
self.write_file(decrypted_data) self.write_file(decrypted_data)
GLib.idle_add(self.progressbar.close_dialog) GLib.idle_add(self.progressbar.close_dialog)

View File

@@ -493,8 +493,8 @@ class OMEMOConnection:
event.msg_iq.addChild(node=eme_node) event.msg_iq.addChild(node=eme_node)
# Add Message for devices that dont support OMEMO # Add Message for devices that dont support OMEMO
support_msg = 'You received a message encrypted with ' \ support_msg = _('You received a message encrypted with ' \
'OMEMO but your client doesnt support OMEMO.' 'OMEMO but your client doesnt support OMEMO.')
event.msg_iq.setBody(support_msg) event.msg_iq.setBody(support_msg)
# Store Hint for MAM # Store Hint for MAM

View File

@@ -192,10 +192,10 @@ class OMEMOConfigDialog(GajimPluginConfigDialog):
fpr = fpr[31:-12] fpr = fpr[31:-12]
YesNoDialog( YesNoDialog(
'Delete Fingerprint?', _('Delete Fingerprint?'),
'Do you want to delete the ' _('Do you want to delete the '
'fingerprint of <b>{}</b> on your account <b>{}</b>?' 'fingerprint of <b>{jid}</b> on your account <b>{account}</b>?'
'\n\n<tt>{}</tt>'.format(jid, account, fpr), '\n\n<tt>{fingerprint}</tt>').format(jid=jid, account=account, fingerprint=fpr),
on_response_yes=on_yes, transient_for=self) on_response_yes=on_yes, transient_for=self)
def trust_button_clicked_cb(self, button, *args): def trust_button_clicked_cb(self, button, *args):
@@ -223,10 +223,10 @@ class OMEMOConfigDialog(GajimPluginConfigDialog):
identity_key = record.getSessionState().getRemoteIdentityKey() identity_key = record.getSessionState().getRemoteIdentityKey()
YesNoDialog( YesNoDialog(
'Trust / Revoke Fingerprint?', _('Trust / Revoke Fingerprint?'),
'Do you want to trust the fingerprint of <b>{}</b> ' _('Do you want to trust the fingerprint of <b>{jid}</b> '
'on your account <b>{}</b>?\n\n' 'on your account <b>{account}</b>?\n\n'
'<tt>{}</tt>'.format(jid, account, fpr), '<tt>{fingerprint}</tt>').format(jid=jid, account=account, fingerprint=fpr),
on_response_yes=(on_yes, identity_key), on_response_yes=(on_yes, identity_key),
on_response_no=(on_no, identity_key), on_response_no=(on_no, identity_key),
transient_for=self) transient_for=self)
@@ -365,7 +365,7 @@ class FingerprintWindow(Gtk.Dialog):
self.omemostate = self.plugin.get_omemo(self.account) self.omemostate = self.plugin.get_omemo(self.account)
self.own_jid = app.get_jid_from_account(self.account) self.own_jid = app.get_jid_from_account(self.account)
Gtk.Dialog.__init__(self, Gtk.Dialog.__init__(self,
title=('Fingerprints for %s') % contact.jid, title=(_('Fingerprints for %s')) % contact.jid,
parent=parent, parent=parent,
flags=Gtk.DialogFlags.DESTROY_WITH_PARENT) flags=Gtk.DialogFlags.DESTROY_WITH_PARENT)
close_button = self.add_button(Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE) close_button = self.add_button(Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE)
@@ -432,10 +432,10 @@ class FingerprintWindow(Gtk.Dialog):
identity_key = record.getSessionState().getRemoteIdentityKey() identity_key = record.getSessionState().getRemoteIdentityKey()
YesNoDialog( YesNoDialog(
'Trust / Revoke Fingerprint?', _('Trust / Revoke Fingerprint?'),
'Do you want to trust the fingerprint of <b>{}</b> ' _('Do you want to trust the fingerprint of <b>{jid}</b> '
'on your account <b>{}</b>?\n\n' 'on your account <b>{account}</b>?\n\n'
'<tt>{}</tt>'.format(jid, self.account, fpr), '<tt>{fingerprint}</tt>').format(jid=jid, account=self.account, fingerprint=fpr),
on_response_yes=(on_yes, identity_key), on_response_yes=(on_yes, identity_key),
on_response_no=(on_no, identity_key), on_response_no=(on_no, identity_key),
transient_for=self) transient_for=self)