From 839f281c98aa5138a0db7dbd5d780b98b95433b7 Mon Sep 17 00:00:00 2001 From: Imarok Date: Sun, 28 Apr 2019 15:26:41 +0000 Subject: [PATCH] Don't add the period outside a translated string Previoues version reviewed by: bb Comments by: elexis Differential Revision: https://code.wildfiregames.com/D1366 This was SVN commit r22234. --- .../data/mods/public/gui/common/network.js | 28 ++++++++----------- .../data/mods/public/gui/session/messages.js | 7 ++--- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/binaries/data/mods/public/gui/common/network.js b/binaries/data/mods/public/gui/common/network.js index f1eb8234cb..3bb6f60039 100644 --- a/binaries/data/mods/public/gui/common/network.js +++ b/binaries/data/mods/public/gui/common/network.js @@ -62,18 +62,17 @@ function getDisconnectReason(id, wasConnected) { switch (id) { - case 0: return wasConnected ? - translateWithContext("network disconnect", "Unknown reason") : - translate("This is often caused by UDP port 20595 not being forwarded on the host side, by a firewall, or anti-virus software"); - case 1: return translate("The host has ended the game"); - case 2: return translate("Incorrect network protocol version"); - case 3: return translate("Game is loading, please try again later"); - case 4: return translate("Game has already started, no observers allowed"); - case 5: return translate("You have been kicked"); - case 6: return translate("You have been banned"); - case 7: return translate("Playername in use. If you were disconnected, retry in few seconds"); - case 8: return translate("Server full"); - case 9: return translate("Secure lobby authentication failed. Join via lobby"); + case 0: return wasConnected ? "" : + translate("This is often caused by UDP port 20595 not being forwarded on the host side, by a firewall, or anti-virus software."); + case 1: return translate("The host has ended the game."); + case 2: return translate("Incorrect network protocol version."); + case 3: return translate("Game is loading, please try again later."); + case 4: return translate("Game has already started, no observers allowed."); + case 5: return translate("You have been kicked."); + case 6: return translate("You have been banned."); + case 7: return translate("Playername in use. If you were disconnected, retry in few seconds."); + case 8: return translate("Server full."); + case 9: return translate("Secure lobby authentication failed. Join via lobby."); default: warn("Unknown disconnect-reason ID received: " + id); return sprintf(translate("\\[Invalid value %(id)s]"), { "id": id }); @@ -87,15 +86,12 @@ function getDisconnectReason(id, wasConnected) */ function reportDisconnect(reason, wasConnected) { - // Translation: States the reason why the client disconnected from the server. - let reasonText = sprintf(translate("Reason: %(reason)s."), { "reason": getDisconnectReason(reason, wasConnected) }); - messageBox( 400, 200, (wasConnected ? translate("Lost connection to the server.") : translate("Failed to connect to the server.") - ) + "\n\n" + reasonText, + ) + "\n\n" + getDisconnectReason(reason, wasConnected), translate("Disconnected") ); } diff --git a/binaries/data/mods/public/gui/session/messages.js b/binaries/data/mods/public/gui/session/messages.js index d415a496c9..aa24a96696 100644 --- a/binaries/data/mods/public/gui/session/messages.js +++ b/binaries/data/mods/public/gui/session/messages.js @@ -150,12 +150,9 @@ var g_StatusMessageTypes = { "authenticated": msg => translate("Connection to the server has been authenticated."), "connected": msg => translate("Connected to the server."), "disconnected": msg => translate("Connection to the server has been lost.") + "\n" + - // Translation: States the reason why the client disconnected from the server. - sprintf(translate("Reason: %(reason)s."), { - "reason": getDisconnectReason(msg.reason, true) - }), + getDisconnectReason(msg.reason, true), "waiting_for_players": msg => translate("Waiting for players to connect:"), - "join_syncing": msg => translate("Synchronising gameplay with other players…"), + "join_syncing": msg => translate("Synchronizing gameplay with other players…"), "active": msg => "" };