From 7de4d94aff076ea647c2fff0e2658ed8e257ab86 Mon Sep 17 00:00:00 2001 From: nordsoft Date: Thu, 22 Sep 2022 20:06:14 +0400 Subject: [PATCH] Move text string to translations.json --- client/CServerHandler.cpp | 5 +++-- config/translate.json | 31 +++++++++++++++++++------------ 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/client/CServerHandler.cpp b/client/CServerHandler.cpp index 12f2b9f76..91532bbe9 100644 --- a/client/CServerHandler.cpp +++ b/client/CServerHandler.cpp @@ -163,11 +163,12 @@ void CServerHandler::startLocalServerAndConnect() th->update(); + auto errorMsg = CGI->generaltexth->localizedTexts["server"]["errors"]["existingProcess"].String(); try { CConnection testConnection(settings["server"]["server"].String(), getDefaultPort(), NAME, uuid); - logNetwork->error("Port is busy, kill other vcmiserver processes"); - CInfoWindow::showInfoDialog("Port is busy, kill other vcmiserver processes", CInfoWindow::TCompsInfo(), PlayerColor(1)); + logNetwork->error("Port is busy, check if another instance of vcmiserver is working"); + CInfoWindow::showInfoDialog(errorMsg, {}); return; } catch(...) diff --git a/config/translate.json b/config/translate.json index 0071d4971..757bfb9d0 100644 --- a/config/translate.json +++ b/config/translate.json @@ -23,6 +23,13 @@ }, "playerAttacked" : "Player has been attacked: %s" }, + "server" : + { + "errors" : + { + "existingProcess" : "Another vcmiserver process is running, please terminate it first" + } + }, "systemOptions" : { "fullscreenButton" : @@ -62,18 +69,18 @@ "allOf" : "All of the following:", "noneOf" : "None of the following:" }, - "heroWindow": - { - "openCommander": - { - "label": "Open commander window", - "help": "Displays information about commander of this hero" - } - }, - "commanderWindow": - { - "artifactMessage": "Do you want to give this artifact back to hero?" - }, + "heroWindow" : + { + "openCommander" : + { + "label" : "Open commander window", + "help" : "Displays information about commander of this hero" + } + }, + "commanderWindow": + { + "artifactMessage": "Do you want to give this artifact back to hero?" + }, "creatureWindow" : { "showBonuses" :