From 3ee76100158e802dbd595adececad7bd8b640797 Mon Sep 17 00:00:00 2001 From: Michael <13953785+Laserlicht@users.noreply.github.com> Date: Sun, 28 May 2023 14:58:21 +0200 Subject: [PATCH 1/4] added missing translation strings --- Mods/vcmi/config/vcmi/english.json | 8 ++++++++ Mods/vcmi/config/vcmi/german.json | 10 +++++++++- client/mainmenu/CMainMenu.cpp | 18 +++++++++--------- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/Mods/vcmi/config/vcmi/english.json b/Mods/vcmi/config/vcmi/english.json index cb05adf4c..1f87e2933 100644 --- a/Mods/vcmi/config/vcmi/english.json +++ b/Mods/vcmi/config/vcmi/english.json @@ -30,6 +30,14 @@ "vcmi.capitalColors.6" : "Teal", "vcmi.capitalColors.7" : "Pink", + "vcmi.mainMenu.tutorialNotImplemented" : "Sorry, tutorial is not implemented yet\n", + "vcmi.mainMenu.highscoresNotImplemented" : "Sorry, high scores menu is not implemented yet\n", + "vcmi.mainMenu.serverConnecting" : "Connecting...", + "vcmi.mainMenu.serverAddressEnter" : "Enter address:", + "vcmi.mainMenu.serverClosing" : "Closing...", + "vcmi.mainMenu.hostTCP" : "Host TCP/IP game", + "vcmi.mainMenu.joinTCP" : "Join TCP/IP game", + "vcmi.server.errors.existingProcess" : "Another VCMI server process is running. Please terminate it before starting a new game.", "vcmi.server.errors.modsIncompatibility" : "The following mods are required to load the game:", "vcmi.server.confirmReconnect" : "Do you want to reconnect to the last session?", diff --git a/Mods/vcmi/config/vcmi/german.json b/Mods/vcmi/config/vcmi/german.json index 3f17d3910..552087231 100644 --- a/Mods/vcmi/config/vcmi/german.json +++ b/Mods/vcmi/config/vcmi/german.json @@ -30,6 +30,14 @@ "vcmi.capitalColors.6" : "Türkis", "vcmi.capitalColors.7" : "Rosa", + "vcmi.mainMenu.tutorialNotImplemented" : "Das Tutorial ist aktuell noch nicht implementiert\n", + "vcmi.mainMenu.highscoresNotImplemented" : "Die Highscores sind aktuell noch nicht implementiert\n", + "vcmi.mainMenu.serverConnecting" : "Verbinde...", + "vcmi.mainMenu.serverAddressEnter" : "Addresse eingeben:", + "vcmi.mainMenu.serverClosing" : "Trenne...", + "vcmi.mainMenu.hostTCP" : "Hoste TCP/IP Spiel", + "vcmi.mainMenu.joinTCP" : "Trete TCP/IP Spiel bei", + "vcmi.server.errors.existingProcess" : "Es läuft ein weiterer vcmiserver-Prozess, bitte beendet diesen zuerst", "vcmi.server.errors.modsIncompatibility" : "Erforderliche Mods um das Spiel zu laden:", "vcmi.server.confirmReconnect" : "Mit der letzten Sitzung verbinden?", @@ -104,7 +112,7 @@ "vcmi.otherOptions.availableCreaturesAsDwellingLabel.hover" : "Verfügbare Kreaturen anzeigen", "vcmi.otherOptions.availableCreaturesAsDwellingLabel.help" : "{Verfügbare Kreaturen anzeigen}\n\n Zeigt in der Stadtübersicht (linke untere Ecke) die zum Kauf verfügbaren Kreaturen anstelle ihres Wachstums an.", - "vcmi.otherOptions.creatureGrowthAsDwellingLabel.hover" : "Wöchentliches Wachstum der Kreaturen anzeigen", + "vcmi.otherOptions.creatureGrowthAsDwellingLabel.hover" : "Wöchentl. Wachstum der Kreaturen anz.", "vcmi.otherOptions.creatureGrowthAsDwellingLabel.help" : "{Wöchentliches Wachstum der Kreaturen anzeigen}\n\n Zeigt das wöchentliche Wachstum der Kreaturen anstelle der verfügbaren Menge in der Stadtübersicht (unten links).", "vcmi.otherOptions.compactTownCreatureInfo.hover": "Kompakte Kreatur-Infos", "vcmi.otherOptions.compactTownCreatureInfo.help": "{Kompakte Kreatur-Infos}\n\n Kleinere Stadt-Kreaturen Informationen in der Stadtübersicht.", diff --git a/client/mainmenu/CMainMenu.cpp b/client/mainmenu/CMainMenu.cpp index 6d2cda6ff..c05fadc5b 100644 --- a/client/mainmenu/CMainMenu.cpp +++ b/client/mainmenu/CMainMenu.cpp @@ -182,7 +182,7 @@ static std::function genCommand(CMenuScreen * menu, std::vector>(), PlayerColor(1)); + return std::bind(CInfoWindow::showInfoDialog, CGI->generaltexth->translate("vcmi.mainMenu.tutorialNotImplemented"), std::vector>(), PlayerColor(1)); } break; } @@ -197,7 +197,7 @@ static std::function genCommand(CMenuScreen * menu, std::vector>(), PlayerColor(1)); + return std::bind(CInfoWindow::showInfoDialog, CGI->generaltexth->translate("vcmi.mainMenu.tutorialNotImplemented"), std::vector>(), PlayerColor(1)); } } break; @@ -208,7 +208,7 @@ static std::function genCommand(CMenuScreen * menu, std::vector>(), PlayerColor(1)); + return std::bind(CInfoWindow::showInfoDialog, CGI->generaltexth->translate("vcmi.mainMenu.highscoresNotImplemented"), std::vector>(), PlayerColor(1)); } } } @@ -404,8 +404,8 @@ CMultiMode::CMultiMode(ESelectionScreen ScreenType) playerName->cb += std::bind(&CMultiMode::onNameChange, this, _1); buttonHotseat = std::make_shared(Point(373, 78), "MUBHOT.DEF", CGI->generaltexth->zelp[266], std::bind(&CMultiMode::hostTCP, this)); - buttonHost = std::make_shared(Point(373, 78 + 57 * 1), "MUBHOST.DEF", CButton::tooltip("Host TCP/IP game", ""), std::bind(&CMultiMode::hostTCP, this)); - buttonJoin = std::make_shared(Point(373, 78 + 57 * 2), "MUBJOIN.DEF", CButton::tooltip("Join TCP/IP game", ""), std::bind(&CMultiMode::joinTCP, this)); + buttonHost = std::make_shared(Point(373, 78 + 57 * 1), "MUBHOST.DEF", CButton::tooltip(CGI->generaltexth->translate("vcmi.mainMenu.hostTCP"), ""), std::bind(&CMultiMode::hostTCP, this)); + buttonJoin = std::make_shared(Point(373, 78 + 57 * 2), "MUBJOIN.DEF", CButton::tooltip(CGI->generaltexth->translate("vcmi.mainMenu.joinTCP"), ""), std::bind(&CMultiMode::joinTCP, this)); buttonCancel = std::make_shared(Point(373, 424), "MUBCANC.DEF", CGI->generaltexth->zelp[288], [=](){ close();}, EShortcut::GLOBAL_CANCEL); } @@ -486,12 +486,12 @@ CSimpleJoinScreen::CSimpleJoinScreen(bool host) inputPort = std::make_shared(Rect(25, 115, 175, 16), background->getSurface()); if(host && !settings["session"]["donotstartserver"].Bool()) { - textTitle->setText("Connecting..."); + textTitle->setText(CGI->generaltexth->translate("vcmi.mainMenu.serverConnecting")); startConnectThread(); } else { - textTitle->setText("Enter address:"); + textTitle->setText(CGI->generaltexth->translate("vcmi.mainMenu.serverAddressEnter")); inputAddress->cb += std::bind(&CSimpleJoinScreen::onChange, this, _1); inputPort->cb += std::bind(&CSimpleJoinScreen::onChange, this, _1); inputPort->filters += std::bind(&CTextInput::numberFilter, _1, _2, 0, 65535); @@ -508,7 +508,7 @@ CSimpleJoinScreen::CSimpleJoinScreen(bool host) void CSimpleJoinScreen::connectToServer() { - textTitle->setText("Connecting..."); + textTitle->setText(CGI->generaltexth->translate("vcmi.mainMenu.serverConnecting")); buttonOk->block(true); GH.stopTextInput(); @@ -519,7 +519,7 @@ void CSimpleJoinScreen::leaveScreen() { if(CSH->state == EClientState::CONNECTING) { - textTitle->setText("Closing..."); + textTitle->setText(CGI->generaltexth->translate("vcmi.mainMenu.serverClosing")); CSH->state = EClientState::CONNECTION_CANCELLED; } else if(GH.windows().isTopWindow(this)) From ee49487dc80729073975943e234b7f961476736d Mon Sep 17 00:00:00 2001 From: Michael <13953785+Laserlicht@users.noreply.github.com> Date: Sun, 28 May 2023 15:29:42 +0200 Subject: [PATCH 2/4] german translation --- Mods/vcmi/config/vcmi/german.json | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Mods/vcmi/config/vcmi/german.json b/Mods/vcmi/config/vcmi/german.json index 552087231..4cb949f1a 100644 --- a/Mods/vcmi/config/vcmi/german.json +++ b/Mods/vcmi/config/vcmi/german.json @@ -54,11 +54,18 @@ "vcmi.systemOptions.otherGroup" : "Andere Einstellungen", // unused right now "vcmi.systemOptions.townsGroup" : "Stadt-Bildschirm", + "vcmi.systemOptions.fullscreenBorderless.hover" : "Vollbild (randlos)", + "vcmi.systemOptions.fullscreenBorderless.help" : "{Randloses Vollbild}\n\nWenn diese Option ausgewählt ist, wird VCMI im randlosen Vollbildmodus ausgeführt. In diesem Modus wird das Spiel immer dieselbe Auflösung wie der Desktop verwenden und die gewählte Auflösung ignorieren.", + "vcmi.systemOptions.fullscreenExclusive.hover" : "Vollbild (exklusiv)", + "vcmi.systemOptions.fullscreenExclusive.help" : "{Vollbild}\n\nWenn diese Option ausgewählt ist, wird VCMI im exklusiven Vollbildmodus ausgeführt. In diesem Modus ändert das Spiel die Auflösung des Monitors auf die ausgewählte Auflösung.", "vcmi.systemOptions.resolutionButton.hover" : "Auflösung: %wx%h", - "vcmi.systemOptions.resolutionButton.help" : "{Wähle Auflösung}\n\n Ändert die Spielauflösung. Spielneustart ist erforderlich um neue Auflösung zu übernehmen.", + "vcmi.systemOptions.resolutionButton.help" : "{Wähle Auflösung}\n\n Ändert die Spielauflösung.", "vcmi.systemOptions.resolutionMenu.hover" : "Wähle Auflösung", "vcmi.systemOptions.resolutionMenu.help" : "Ändere die Spielauflösung.", - "vcmi.systemOptions.fullscreenFailed" : "{Vollbild}\n\n Der Wechsel in den Vollbildmodus ist fehlgeschlagen! Die aktuelle Auflösung wird von der Anzeige nicht unterstützt!", + "vcmi.systemOptions.scalingButton.hover" : "Interface-Skalierung: %p%", + "vcmi.systemOptions.scalingButton.help" : "{Interface-Skalierung}\n\nÄndern der Skalierung des Interfaces im Spiel", + "vcmi.systemOptions.scalingMenu.hover" : "Skalierung des Interfaces auswählen", + "vcmi.systemOptions.scalingMenu.help" : "Ändern der Skalierung des Interfaces im Spiel.", "vcmi.systemOptions.framerateButton.hover" : "FPS anzeigen", "vcmi.systemOptions.framerateButton.help" : "{FPS anzeigen}\n\n Schaltet die Sichtbarkeit des Zählers für die Bilder pro Sekunde in der Ecke des Spielfensters um.", @@ -94,9 +101,12 @@ "vcmi.battleOptions.animationsSpeed1.help": "Setzt die Animationsgeschwindigkeit auf sehr langsam", "vcmi.battleOptions.animationsSpeed5.help": "Setzt die Animationsgeschwindigkeit auf sehr schnell", "vcmi.battleOptions.animationsSpeed6.help": "Setzt die Animationsgeschwindigkeit auf sofort", + "vcmi.battleOptions.touchscreenMode.hover": "Touchscreen-Modus", + "vcmi.battleOptions.touchscreenMode.help": "{Touchscreen-Modus}\n\nFalls aktiviert, ist ein zweiter Klick erforderlich, um die Aktion zu bestätigen und auszuführen. Dies ist besser für Touchscreen-Geräte geeignet.", + "vcmi.battleOptions.movementHighlightOnHover.hover": "Hervorhebung der Bewegung bei Hover", + "vcmi.battleOptions.movementHighlightOnHover.help": "{Hervorhebung der Bewegung bei Hover}\n\nHebt die Bewegungsreichweite der Einheit hervor, wenn man mit dem Mauszeiger über sie fährt.", "vcmi.battleOptions.skipBattleIntroMusic.hover": "Intro-Musik überspringen", "vcmi.battleOptions.skipBattleIntroMusic.help": "{Intro-Musik überspringen}\n\n Überspringe die kurze Musik, die zu Beginn eines jeden Kampfes gespielt wird, bevor die Action beginnt. Kann auch durch Drücken der ESC-Taste übersprungen werden.", - "vcmi.battleWindow.pressKeyToSkipIntro" : "Beliebige Taste drücken, um das Kampf-Intro zu überspringen", "vcmi.battleWindow.damageEstimation.melee" : "Angriff auf %CREATURE (%DAMAGE).", @@ -109,6 +119,7 @@ "vcmi.battleWindow.damageEstimation.damage.1" : "%d Schaden", "vcmi.battleWindow.damageEstimation.kills" : "%d werden verenden", "vcmi.battleWindow.damageEstimation.kills.1" : "%d werden verenden", + "vcmi.battleResultsWindow.applyResultsLabel" : "Kampfergebnis übernehmen", "vcmi.otherOptions.availableCreaturesAsDwellingLabel.hover" : "Verfügbare Kreaturen anzeigen", "vcmi.otherOptions.availableCreaturesAsDwellingLabel.help" : "{Verfügbare Kreaturen anzeigen}\n\n Zeigt in der Stadtübersicht (linke untere Ecke) die zum Kauf verfügbaren Kreaturen anstelle ihres Wachstums an.", @@ -298,7 +309,7 @@ "core.bonus.SUMMON_GUARDIANS.description": "Beschwört bei Kampfbeginn ${subtype.creature} (${val}%)", "core.bonus.SYNERGY_TARGET.name": "Synergierbar", "core.bonus.SYNERGY_TARGET.description": "Diese Kreatur ist anfällig für Synergieeffekte", - "core.bonus.TWO_HEX_ATTACK_BREATH.name": "Breath", + "core.bonus.TWO_HEX_ATTACK_BREATH.name": "Atem", "core.bonus.TWO_HEX_ATTACK_BREATH.description": "Atem-Angriff (2-Hex-Bereich)", "core.bonus.THREE_HEADED_ATTACK.name": "Dreiköpfiger Angriff", "core.bonus.THREE_HEADED_ATTACK.description": "Greift drei benachbarte Einheiten an", From 8672fc7e3dccfe224b51496cd8ad6abbfff8b354 Mon Sep 17 00:00:00 2001 From: Michael <13953785+Laserlicht@users.noreply.github.com> Date: Sun, 28 May 2023 16:57:24 +0200 Subject: [PATCH 3/4] Allows to translate default playername --- Mods/vcmi/config/vcmi/english.json | 1 + Mods/vcmi/config/vcmi/german.json | 1 + client/mainmenu/CMainMenu.cpp | 14 +++++++++++--- client/mainmenu/CMainMenu.h | 1 + 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Mods/vcmi/config/vcmi/english.json b/Mods/vcmi/config/vcmi/english.json index 1f87e2933..8bd3e83c9 100644 --- a/Mods/vcmi/config/vcmi/english.json +++ b/Mods/vcmi/config/vcmi/english.json @@ -37,6 +37,7 @@ "vcmi.mainMenu.serverClosing" : "Closing...", "vcmi.mainMenu.hostTCP" : "Host TCP/IP game", "vcmi.mainMenu.joinTCP" : "Join TCP/IP game", + "vcmi.mainMenu.playerName" : "Player", "vcmi.server.errors.existingProcess" : "Another VCMI server process is running. Please terminate it before starting a new game.", "vcmi.server.errors.modsIncompatibility" : "The following mods are required to load the game:", diff --git a/Mods/vcmi/config/vcmi/german.json b/Mods/vcmi/config/vcmi/german.json index 4cb949f1a..8cf77ffbc 100644 --- a/Mods/vcmi/config/vcmi/german.json +++ b/Mods/vcmi/config/vcmi/german.json @@ -37,6 +37,7 @@ "vcmi.mainMenu.serverClosing" : "Trenne...", "vcmi.mainMenu.hostTCP" : "Hoste TCP/IP Spiel", "vcmi.mainMenu.joinTCP" : "Trete TCP/IP Spiel bei", + "vcmi.mainMenu.playerName" : "Spieler", "vcmi.server.errors.existingProcess" : "Es läuft ein weiterer vcmiserver-Prozess, bitte beendet diesen zuerst", "vcmi.server.errors.modsIncompatibility" : "Erforderliche Mods um das Spiel zu laden:", diff --git a/client/mainmenu/CMainMenu.cpp b/client/mainmenu/CMainMenu.cpp index c05fadc5b..2bc67d6c1 100644 --- a/client/mainmenu/CMainMenu.cpp +++ b/client/mainmenu/CMainMenu.cpp @@ -400,7 +400,7 @@ CMultiMode::CMultiMode(ESelectionScreen ScreenType) statusBar = CGStatusBar::create(std::make_shared(background->getSurface(), Rect(7, 465, 440, 18), 7, 465)); playerName = std::make_shared(Rect(19, 436, 334, 16), background->getSurface()); - playerName->setText(settings["general"]["playerName"].String()); + playerName->setText(getDefaultPlayerName()); playerName->cb += std::bind(&CMultiMode::onNameChange, this, _1); buttonHotseat = std::make_shared(Point(373, 78), "MUBHOT.DEF", CGI->generaltexth->zelp[266], std::bind(&CMultiMode::hostTCP, this)); @@ -413,14 +413,22 @@ void CMultiMode::hostTCP() { auto savedScreenType = screenType; close(); - GH.windows().createAndPushWindow(settings["general"]["playerName"].String(), savedScreenType, true, ELoadMode::MULTI); + GH.windows().createAndPushWindow(getDefaultPlayerName(), savedScreenType, true, ELoadMode::MULTI); } void CMultiMode::joinTCP() { auto savedScreenType = screenType; close(); - GH.windows().createAndPushWindow(settings["general"]["playerName"].String(), savedScreenType, false, ELoadMode::MULTI); + GH.windows().createAndPushWindow(getDefaultPlayerName(), savedScreenType, false, ELoadMode::MULTI); +} + +std::string CMultiMode::getDefaultPlayerName() +{ + std::string name = settings["general"]["playerName"].String(); + if(name == "Player") + name = CGI->generaltexth->translate("vcmi.mainMenu.playerName"); + return name; } void CMultiMode::onNameChange(std::string newText) diff --git a/client/mainmenu/CMainMenu.h b/client/mainmenu/CMainMenu.h index 0f7d79dc3..f0285bb65 100644 --- a/client/mainmenu/CMainMenu.h +++ b/client/mainmenu/CMainMenu.h @@ -91,6 +91,7 @@ public: CMultiMode(ESelectionScreen ScreenType); void hostTCP(); void joinTCP(); + getDefaultPlayerName() void onNameChange(std::string newText); }; From eb618fbff94eb5e921bda34f451c6497c286b25c Mon Sep 17 00:00:00 2001 From: Michael <13953785+Laserlicht@users.noreply.github.com> Date: Sun, 28 May 2023 17:29:11 +0200 Subject: [PATCH 4/4] rename function --- client/mainmenu/CMainMenu.cpp | 8 ++++---- client/mainmenu/CMainMenu.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/mainmenu/CMainMenu.cpp b/client/mainmenu/CMainMenu.cpp index 2bc67d6c1..5e01f213a 100644 --- a/client/mainmenu/CMainMenu.cpp +++ b/client/mainmenu/CMainMenu.cpp @@ -400,7 +400,7 @@ CMultiMode::CMultiMode(ESelectionScreen ScreenType) statusBar = CGStatusBar::create(std::make_shared(background->getSurface(), Rect(7, 465, 440, 18), 7, 465)); playerName = std::make_shared(Rect(19, 436, 334, 16), background->getSurface()); - playerName->setText(getDefaultPlayerName()); + playerName->setText(getPlayerName()); playerName->cb += std::bind(&CMultiMode::onNameChange, this, _1); buttonHotseat = std::make_shared(Point(373, 78), "MUBHOT.DEF", CGI->generaltexth->zelp[266], std::bind(&CMultiMode::hostTCP, this)); @@ -413,17 +413,17 @@ void CMultiMode::hostTCP() { auto savedScreenType = screenType; close(); - GH.windows().createAndPushWindow(getDefaultPlayerName(), savedScreenType, true, ELoadMode::MULTI); + GH.windows().createAndPushWindow(getPlayerName(), savedScreenType, true, ELoadMode::MULTI); } void CMultiMode::joinTCP() { auto savedScreenType = screenType; close(); - GH.windows().createAndPushWindow(getDefaultPlayerName(), savedScreenType, false, ELoadMode::MULTI); + GH.windows().createAndPushWindow(getPlayerName(), savedScreenType, false, ELoadMode::MULTI); } -std::string CMultiMode::getDefaultPlayerName() +std::string CMultiMode::getPlayerName() { std::string name = settings["general"]["playerName"].String(); if(name == "Player") diff --git a/client/mainmenu/CMainMenu.h b/client/mainmenu/CMainMenu.h index f0285bb65..02f34ba7f 100644 --- a/client/mainmenu/CMainMenu.h +++ b/client/mainmenu/CMainMenu.h @@ -91,7 +91,7 @@ public: CMultiMode(ESelectionScreen ScreenType); void hostTCP(); void joinTCP(); - getDefaultPlayerName() + std::string getPlayerName(); void onNameChange(std::string newText); };