if we are english dont duplicate gpg strings

This commit is contained in:
Nikos Kouremenos 2005-07-06 12:13:54 +00:00
parent 7877b5c2ac
commit 949c105312
2 changed files with 16 additions and 8 deletions

View File

@ -853,8 +853,11 @@ class Connection:
#encrypt #encrypt
msgenc = self.gpg.encrypt(msg, [keyID]) msgenc = self.gpg.encrypt(msg, [keyID])
if msgenc: if msgenc:
msgtxt = _('[This message is encrypted]') +\ msgtxt = '[This message is encrypted]'
' [This message is encrypted]' # once translated and once english 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': if type == 'chat':
msg_iq = common.xmpp.Message(to = jid, body = msgtxt, typ = type) msg_iq = common.xmpp.Message(to = jid, body = msgtxt, typ = type)
else: else:

View File

@ -387,15 +387,20 @@ class TabbedChatWindow(chat.Chat):
else: else:
ec = gajim.encrypted_chats[self.account] ec = gajim.encrypted_chats[self.account]
if encrypted and jid not in ec: if encrypted and jid not in ec:
msg_in_two_langs = _('Encryption enabled')\ msg = 'Encryption enabled
+ ' - Encryption enabled' lang = os.getenv('LANG')
chat.Chat.print_conversation_line(self, msg_in_two_langs, jid, 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) 'status', '', tim)
ec.append(jid) ec.append(jid)
if not encrypted and jid in ec: if not encrypted and jid in ec:
msg_in_two_langs = _('Encryption disabled')\ msg = 'Encryption disabled'
+ ' - Encryption disabled' lang = os.getenv('LANG')
chat.Chat.print_conversation_line(self, msg_in_two_langs, jid, 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) 'status', '', tim)
ec.remove(jid) ec.remove(jid)
self.xmls[jid].get_widget('gpg_togglebutton').set_active(encrypted) self.xmls[jid].get_widget('gpg_togglebutton').set_active(encrypted)