فهرست منبع

Move text string to translations.json

nordsoft 3 سال پیش
والد
کامیت
7de4d94aff
2فایلهای تغییر یافته به همراه22 افزوده شده و 14 حذف شده
  1. 3 2
      client/CServerHandler.cpp
  2. 19 12
      config/translate.json

+ 3 - 2
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(...)

+ 19 - 12
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" :