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
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:

View File

@ -387,15 +387,20 @@ class TabbedChatWindow(chat.Chat):
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)