diff --git a/omemo/file_crypto.py b/omemo/file_crypto.py index e76b9e3..646f59b 100644 --- a/omemo/file_crypto.py +++ b/omemo/file_crypto.py @@ -144,8 +144,8 @@ class FileDecryption: file.filepath = os.path.join(DIRECTORY, newfilename) def finished(self, file): - question = 'Do you want to open %s' % file.filename - YesNoDialog('Open File', question, + question = _('Do you want to open %s') % file.filename + YesNoDialog(_('Open File'), question, transient_for=self.window, on_response_yes=(self.open_file, file.filepath)) return False @@ -169,18 +169,18 @@ class Download: self.download() def download(self): - GLib.idle_add(self.progressbar.set_text, 'Downloading...') + GLib.idle_add(self.progressbar.set_text, _('Downloading...')) data = self.load_url() if isinstance(data, str): GLib.idle_add(self.progressbar.close_dialog) GLib.idle_add(self.error, data) return - GLib.idle_add(self.progressbar.set_text, 'Decrypting...') + GLib.idle_add(self.progressbar.set_text, _('Decrypting...')) decrypted_data = self.aes_decrypt(data) GLib.idle_add( - self.progressbar.set_text, 'Writing file to harddisk...') + self.progressbar.set_text, _('Writing file to harddisk...')) self.write_file(decrypted_data) GLib.idle_add(self.progressbar.close_dialog) diff --git a/omemo/omemo_connection.py b/omemo/omemo_connection.py index 60d8603..e3995f1 100644 --- a/omemo/omemo_connection.py +++ b/omemo/omemo_connection.py @@ -493,8 +493,8 @@ class OMEMOConnection: event.msg_iq.addChild(node=eme_node) # Add Message for devices that dont support OMEMO - support_msg = 'You received a message encrypted with ' \ - 'OMEMO but your client doesnt support OMEMO.' + support_msg = _('You received a message encrypted with ' \ + 'OMEMO but your client doesnt support OMEMO.') event.msg_iq.setBody(support_msg) # Store Hint for MAM diff --git a/omemo/ui.py b/omemo/ui.py index e95ec07..4db7595 100644 --- a/omemo/ui.py +++ b/omemo/ui.py @@ -192,10 +192,10 @@ class OMEMOConfigDialog(GajimPluginConfigDialog): fpr = fpr[31:-12] YesNoDialog( - 'Delete Fingerprint?', - 'Do you want to delete the ' - 'fingerprint of {} on your account {}?' - '\n\n{}'.format(jid, account, fpr), + _('Delete Fingerprint?'), + _('Do you want to delete the ' + 'fingerprint of {jid} on your account {account}?' + '\n\n{fingerprint}').format(jid=jid, account=account, fingerprint=fpr), on_response_yes=on_yes, transient_for=self) def trust_button_clicked_cb(self, button, *args): @@ -223,10 +223,10 @@ class OMEMOConfigDialog(GajimPluginConfigDialog): identity_key = record.getSessionState().getRemoteIdentityKey() YesNoDialog( - 'Trust / Revoke Fingerprint?', - 'Do you want to trust the fingerprint of {} ' - 'on your account {}?\n\n' - '{}'.format(jid, account, fpr), + _('Trust / Revoke Fingerprint?'), + _('Do you want to trust the fingerprint of {jid} ' + 'on your account {account}?\n\n' + '{fingerprint}').format(jid=jid, account=account, fingerprint=fpr), on_response_yes=(on_yes, identity_key), on_response_no=(on_no, identity_key), transient_for=self) @@ -365,7 +365,7 @@ class FingerprintWindow(Gtk.Dialog): self.omemostate = self.plugin.get_omemo(self.account) self.own_jid = app.get_jid_from_account(self.account) Gtk.Dialog.__init__(self, - title=('Fingerprints for %s') % contact.jid, + title=(_('Fingerprints for %s')) % contact.jid, parent=parent, flags=Gtk.DialogFlags.DESTROY_WITH_PARENT) close_button = self.add_button(Gtk.STOCK_CLOSE, Gtk.ResponseType.CLOSE) @@ -432,10 +432,10 @@ class FingerprintWindow(Gtk.Dialog): identity_key = record.getSessionState().getRemoteIdentityKey() YesNoDialog( - 'Trust / Revoke Fingerprint?', - 'Do you want to trust the fingerprint of {} ' - 'on your account {}?\n\n' - '{}'.format(jid, self.account, fpr), + _('Trust / Revoke Fingerprint?'), + _('Do you want to trust the fingerprint of {jid} ' + 'on your account {account}?\n\n' + '{fingerprint}').format(jid=jid, account=self.account, fingerprint=fpr), on_response_yes=(on_yes, identity_key), on_response_no=(on_no, identity_key), transient_for=self)