Skip to content
Snippets Groups Projects
Commit 949c1053 authored by nkour's avatar nkour
Browse files

if we are english dont duplicate gpg strings

parent 7877b5c2
No related branches found
No related tags found
No related merge requests found
......@@ -853,8 +853,11 @@ def send_message(self, jid, msg, keyID, type = 'chat', subject=''):
#encrypt
msgenc = self.gpg.encrypt(msg, [keyID])
if msgenc:
msgtxt = _('[This message is encrypted]') +\
' [This message is encrypted]' # once translated and once english
msgtxt = '[This message is encrypted]'
lang = os.getenv('LANG')
if lang is not None or lang != 'en': # we're not english
msgtxt = _('[This message is encrypted]') +\
' ([This message is encrypted])' # one in locale and one en
if type == 'chat':
msg_iq = common.xmpp.Message(to = jid, body = msgtxt, typ = type)
else:
......
......@@ -387,15 +387,20 @@ def print_conversation(self, text, jid, contact = '', tim = None,
else:
ec = gajim.encrypted_chats[self.account]
if encrypted and jid not in ec:
msg_in_two_langs = _('Encryption enabled')\
+ ' - Encryption enabled'
chat.Chat.print_conversation_line(self, msg_in_two_langs, jid,
msg = 'Encryption enabled
lang = os.getenv('LANG')
if lang is not None or lang != 'en': # we're not english
msg = _('Encryption enabled')\
+ ' (Encryption enabled)' # one in locale and one in en
chat.Chat.print_conversation_line(self, msg, jid,
'status', '', tim)
ec.append(jid)
if not encrypted and jid in ec:
msg_in_two_langs = _('Encryption disabled')\
+ ' - Encryption disabled'
chat.Chat.print_conversation_line(self, msg_in_two_langs, jid,
msg = 'Encryption disabled'
lang = os.getenv('LANG')
if lang is not None or lang != 'en': # we're not english
msg = _('Encryption disabled') + ' (Encryption disabled)'
chat.Chat.print_conversation_line(self, msg, jid,
'status', '', tim)
ec.remove(jid)
self.xmls[jid].get_widget('gpg_togglebutton').set_active(encrypted)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment