From 949c10531284a0d975dc1dd71cf62eea5e21b2d3 Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Wed, 6 Jul 2005 12:13:54 +0000 Subject: [PATCH] if we are english dont duplicate gpg strings --- src/common/connection.py | 7 +++++-- src/tabbed_chat_window.py | 17 +++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index 8fb16bdf7..4d8412b09 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -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: diff --git a/src/tabbed_chat_window.py b/src/tabbed_chat_window.py index 0b99083ad..23d9f8c73 100644 --- a/src/tabbed_chat_window.py +++ b/src/tabbed_chat_window.py @@ -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)