From 3fc9dcf0af97d49e7ea75f84ee8e6c99127c505b Mon Sep 17 00:00:00 2001 From: Alberto Sottile Date: Tue, 5 Feb 2019 16:48:23 +0100 Subject: [PATCH] startTLS: handle ui messages --- syncplay/messages_de.py | 4 ++-- syncplay/messages_en.py | 6 +++--- syncplay/messages_it.py | 4 ++-- syncplay/messages_ru.py | 4 ++-- syncplay/protocols.py | 8 ++++---- syncplay/server.py | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/syncplay/messages_de.py b/syncplay/messages_de.py index 1adbfb9..e67cbf8 100755 --- a/syncplay/messages_de.py +++ b/syncplay/messages_de.py @@ -312,8 +312,8 @@ de = { # startTLS messages - TODO: Translate "startTLS-initiated": "Attempting secure connection", - "startTLS-secure-connection-ok": "Secure connection established ({})", - "startTLS-not-supported-client": "This client does not support TLS", + "startTLS-secure-connection-ok": "Secure connection established", + "startTLS-not-supported-client": "TLS is not supported", "startTLS-not-supported-server": "This server does not support TLS", # About dialog - TODO: Translate diff --git a/syncplay/messages_en.py b/syncplay/messages_en.py index e86e0db..f5971cd 100755 --- a/syncplay/messages_en.py +++ b/syncplay/messages_en.py @@ -313,8 +313,8 @@ en = { "update-menu-label": "Check for &update", "startTLS-initiated": "Attempting secure connection", - "startTLS-secure-connection-ok": "Secure connection established ({})", - "startTLS-not-supported-client": "This client does not support TLS", + "startTLS-secure-connection-ok": "Secure connection established", + "startTLS-not-supported-client": "TLS is not supported", "startTLS-not-supported-server": "This server does not support TLS", # About dialog @@ -444,7 +444,7 @@ en = { "server-chat-maxchars-argument": "Maximum number of characters in a chat message (default is {})", # Default number of characters "server-maxusernamelength-argument": "Maximum number of characters in a username (default is {})", "server-stats-db-file-argument": "Enable server stats using the SQLite db file provided", - "server-tls-argument": "Enable TLS connections using the certificate file provided", + "server-startTLS-argument": "Enable TLS connections using the certificate files in the path provided", "server-messed-up-motd-unescaped-placeholders": "Message of the Day has unescaped placeholders. All $ signs should be doubled ($$).", "server-messed-up-motd-too-long": "Message of the Day is too long - maximum of {} chars, {} given.", diff --git a/syncplay/messages_it.py b/syncplay/messages_it.py index 99fd305..33fcab9 100755 --- a/syncplay/messages_it.py +++ b/syncplay/messages_it.py @@ -313,8 +313,8 @@ it = { "update-menu-label": "Controlla la presenza di &aggiornamenti", "startTLS-initiated": "Tentativo di connessione sicura in corso", - "startTLS-secure-connection-ok": "Connessione sicura stabilita ({})", - "startTLS-not-supported-client": "Questo client non supporta TLS", + "startTLS-secure-connection-ok": "Connessione sicura stabilita", + "startTLS-not-supported-client": "TLS non รจ supportato", "startTLS-not-supported-server": "Questo server non supporta TLS", # About dialog diff --git a/syncplay/messages_ru.py b/syncplay/messages_ru.py index b4f6332..7d258a2 100755 --- a/syncplay/messages_ru.py +++ b/syncplay/messages_ru.py @@ -315,8 +315,8 @@ ru = { # startTLS messages - TODO: Translate "startTLS-initiated": "Attempting secure connection", - "startTLS-secure-connection-ok": "Secure connection established ({})", - "startTLS-not-supported-client": "This client does not support TLS", + "startTLS-secure-connection-ok": "Secure connection established", + "startTLS-not-supported-client": "TLS is not supported", "startTLS-not-supported-server": "This server does not support TLS", # About dialog - TODO: Translate diff --git a/syncplay/protocols.py b/syncplay/protocols.py index 9545dce..c06ba2f 100755 --- a/syncplay/protocols.py +++ b/syncplay/protocols.py @@ -79,9 +79,9 @@ class SyncClientProtocol(JSONCommandProtocol): self._client.initProtocol(self) if self._client._serverSupportsTLS: self.sendTLS({"startTLS": "send"}) - self._client.ui.showMessage("Attempting secure connection") + self._client.ui.showMessage(getMessage("startTLS-initiated")) else: - self._client.ui.showErrorMessage("TLS is not supported") + self._client.ui.showErrorMessage(getMessage("startTLS-not-supported-client")) self.sendHello() def connectionLost(self, reason): @@ -328,9 +328,9 @@ class SyncClientProtocol(JSONCommandProtocol): answer = message["startTLS"] if "startTLS" in message else None if "true" in answer and not self.logged and self._client.protocolFactory.options is not None: self.transport.startTLS(self._client.protocolFactory.options) - self._client.ui.showMessage("Secure connection established") + self._client.ui.showMessage(getMessage("startTLS-secure-connection-ok")) elif "false" in answer: - self._client.ui.showErrorMessage("This server does not support TLS") + self._client.ui.showErrorMessage(getMessage("startTLS-not-supported-server")) self.sendHello() class SyncServerProtocol(JSONCommandProtocol): diff --git a/syncplay/server.py b/syncplay/server.py index a76c0a5..4a0c142 100755 --- a/syncplay/server.py +++ b/syncplay/server.py @@ -649,4 +649,4 @@ class ConfigurationGetter(object): self._argparser.add_argument('--max-chat-message-length', metavar='maxChatMessageLength', type=int, nargs='?', help=getMessage("server-chat-maxchars-argument").format(constants.MAX_CHAT_MESSAGE_LENGTH)) self._argparser.add_argument('--max-username-length', metavar='maxUsernameLength', type=int, nargs='?', help=getMessage("server-maxusernamelength-argument").format(constants.MAX_USERNAME_LENGTH)) self._argparser.add_argument('--stats-db-file', metavar='file', type=str, nargs='?', help=getMessage("server-stats-db-file-argument")) - self._argparser.add_argument('--tls', metavar='path', type=str, nargs='?', help=getMessage("server-tls-argument")) + self._argparser.add_argument('--tls', metavar='path', type=str, nargs='?', help=getMessage("server-startTLS-argument"))