Jelajahi Sumber

Merge pull request #5830 from Laserlicht/translate

credits translation
Ivan Savenko 3 bulan lalu
induk
melakukan
b8fa3ccde1

+ 40 - 38
AUTHORS.h

@@ -11,44 +11,46 @@
 
 //VCMI PROJECT CODE CONTRIBUTORS:
 const std::vector<std::vector<std::string>> contributors = {
-//   Task          Name                    Aka                      E-Mail
-   { "Idea",       "Michał Urbańczyk",     "Tow",                   "[email protected]"             },
-   { "Idea",       "Mateusz B.",           "Tow dragon",            "[email protected]"            },
+	//Task          Name                   Aka                    E-Mail
+	{ "Idea"      , "Mateusz B."         , "Tow dragon"         , "[email protected]"            },
+	{ "Idea"      , "Michał Urbańczyk"   , "Tow"                , "[email protected]"             },
 
-   { "Developing", "Andrea Palmate",       "afxgroup",              "[email protected]"         },
-   { "Developing", "Alexander Shishkin",   "alexvins",              ""                             },
-   { "Developing", "Rafal R.",             "ambtrip",               "[email protected]"                },
-   { "Developing", "Andrii Danylchenko",   "",                      ""                             },
-   { "Developing", "Benjamin Gentner",     "beegee",                ""                             },
-   { "Developing", "Piotr Wójcik",         "Chocimier",             "[email protected]"            },
-   { "Developing", "Dmitry Orlov",         "",                      "[email protected]" },
-   { "Developing", "",                     "Dydzio",                "[email protected]"           },
-   { "Developing", "Andrzej Żak",          "godric3",               ""                             },
-   { "Developing", "Henning Koehler",      "henningkoehlernz",      "[email protected]" },
-   { "Developing", "Ivan Savenko",         "",                      "[email protected]"         },
-   { "Developing", "",                     "kambala-decapitator",   "[email protected]"          },
-   { "Developing", "",                     "krs0",                  ""                             },
-   { "Developing", "",                     "Laserlicht",            ""                             },
-   { "Developing", "Alexey",               "Macron1Robot",          ""                             },
-   { "Developing", "Michał Kalinowski",    "",                      "[email protected]"            },
-   { "Developing", "Vadim Glazunov",       "neweagle",              "[email protected]"           },
-   { "Developing", "Andrey Cherkas",       "nordsoft",              "[email protected]"           },
-   { "Developing", "Rickard Westerlund",   "Onion Knight",          "[email protected]"         },
-   { "Developing", "Yifeng Sun",           "phoebus118",            "[email protected]"       },
-   { "Developing", "",                     "rilian-la-te",          ""                             },
-   { "Developing", "",                     "SoundSSGood",           ""                             },
-   { "Developing", "Stefan Pavlov",        "Ste",                   "[email protected]"            },
-   { "Developing", "Arseniy Shestakov",    "SXX",                   "[email protected]"      },
-   { "Developing", "Lukasz Wychrystenko",  "tezeriusz",             "[email protected]"         },
-   { "Developing", "Trevor Standley",      "tstandley",             ""                             },
-   { "Developing", "Vadim Markovtsev",     "",                      "[email protected]"           },
-   { "Developing", "Frank Zago",           "ubuntux",               ""                             },
-   { "Developing", "",                     "vmarkovtsev",           ""                             },
-   { "Developing", "Tom Zielinski",        "Warmonger",             "[email protected]"              },
-   { "Developing", "Xiaomin Ding",         "",                      "[email protected]"        },
-   { "Developing", "Fenghuang Rumeng",     "kdmcser",               "[email protected]"             },
+	{ "Developing", "Alexander Shishkin" , "alexvins"           , ""                             },
+	{ "Developing", "Alexey"             , "Macron1Robot"       , ""                             },
+	{ "Developing", "Andrea Palmate"     , "afxgroup"           , "[email protected]"         },
+	{ "Developing", "Andrey Cherkas"     , "nordsoft"           , "[email protected]"           },
+	{ "Developing", "Andrii Danylchenko" , ""                   , ""                             },
+	{ "Developing", "Andrzej Żak"        , "godric3"            , ""                             },
+	{ "Developing", "Arseniy Shestakov"  , "SXX"                , "[email protected]"      },
+	{ "Developing", "Benjamin Gentner"   , "beegee"             , ""                             },
+	{ "Developing", "Dmitry Orlov"       , ""                   , "[email protected]" },
+	{ "Developing", ""                   , "Dydzio"             , "[email protected]"           },
+	{ "Developing", "Fenghuang Rumeng"   , "kdmcser"            , "[email protected]"            },
+	{ "Developing", "Frank Zago"         , "ubuntux"            , ""                             },
+	{ "Developing", "Henning Koehler"    , "henningkoehlernz"   , "[email protected]" },
+	{ "Developing", "Ivan Savenko"       , ""                   , "[email protected]"         },
+	{ "Developing", ""                   , "kambala-decapitator", "[email protected]"          },
+	{ "Developing", ""                   , "krs0"               , ""                             },
+	{ "Developing", ""                   , "Laserlicht"         , ""                             },
+	{ "Developing", "Lukasz Wychrystenko", "tezeriusz"          , "[email protected]"         },
+	{ "Developing", "Michał Kalinowski"  , ""                   , "[email protected]"            },
+	{ "Developing", "Piotr Wójcik"       , "Chocimier"          , "[email protected]"            },
+	{ "Developing", "Rafal R."           , "ambtrip"            , "[email protected]"                },
+	{ "Developing", "Rickard Westerlund" , "Onion Knight"       , "[email protected]"         },
+	{ "Developing", ""                   , "rilian-la-te"       , ""                             },
+	{ "Developing", ""                   , "SoundSSGood"        , ""                             },
+	{ "Developing", "Stefan Pavlov"      , "Ste"                , "[email protected]"            },
+	{ "Developing", "Tom Zielinski"      , "Warmonger"          , "[email protected]"              },
+	{ "Developing", "Trevor Standley"    , "tstandley"          , ""                             },
+	{ "Developing", "Vadim Glazunov"     , "neweagle"           , "[email protected]"           },
+	{ "Developing", "Vadim Markovtsev"   , ""                   , "[email protected]"           },
+	{ "Developing", ""                   , "vmarkovtsev"        , ""                             },
+	{ "Developing", "Xiaomin Ding"       , ""                   , "[email protected]"        },
+	{ "Developing", "Yifeng Sun"         , "phoebus118"         , "[email protected]"       },
 
-   { "Testing",    "Ben Yan",              "by003",                 "[email protected],"        },
-   { "Testing",    "",                     "Misiokles",             ""                             },
-   { "Testing",    "",                     "Povelitel",             ""                             },
+	{ "Testing"   , "Ben Yan"            , "by003"              , "[email protected]"         },
+	{ "Testing"   , ""                   , "Misiokles"          , ""                             },
+	{ "Testing"   , ""                   , "Povelitel"          , ""                             },
+
+	// List is ordered by "Name" (if empty than "Aka" will used as sorting key)
 };

+ 30 - 0
Mods/vcmi/Content/config/english.json

@@ -417,6 +417,36 @@
 	"vcmi.battleResultsWindow.spellDurationRemaining.1" : "Remaining duration : %d combat round",
 	"vcmi.battleResultsWindow.spellDurationRemaining.2" : "Remaining duration : %d combat rounds",
 
+	"vcmi.credits.website" : "Website",
+	"vcmi.credits.vcmi" : "VCMI",
+	"vcmi.credits.heroes" : "Heroes III",
+	"vcmi.credits.idea" : "Idea",
+	"vcmi.credits.developing" : "Developing",
+	"vcmi.credits.testing" : "Testing",
+	"core.credits.createdBy" : "Created By",
+	"core.credits.executiveProducer" : "Executive Producer",
+	"core.credits.producer" : "Producer",
+	"core.credits.director" : "Director",
+	"core.credits.designers" : "Designers",
+	"core.credits.leadProgrammers" : "Lead Programmers",
+	"core.credits.programmers" : "Programmers",
+	"core.credits.installerProgrammer" : "Installer Programmer",
+	"core.credits.leadArtists" : "Lead Artists",
+	"core.credits.artists" : "Artists",
+	"core.credits.assetCoordinator" : "Asset Coordinator",
+	"core.credits.levelDesigners" : "Level Designers",
+	"core.credits.musicProducer" : "Music Producer",
+	"core.credits.townThemes" : "Town Themes",
+	"core.credits.music" : "Music",
+	"core.credits.soundDesign" : "Sound Design",
+	"core.credits.voiceProduction" : "Voice Production",
+	"core.credits.voiceTalent" : "Voice Talent",
+	"core.credits.leadTester" : "Lead Tester",
+	"core.credits.seniorTester" : "Senior Tester",
+	"core.credits.testers" : "Testers",
+	"core.credits.specialThanks" : "Special Thanks",
+	"core.credits.visitUsOnTheWeb" : "Visit us on the Web",
+
 	"vcmi.tutorialWindow.title" : "Touchscreen Introduction",
 	"vcmi.tutorialWindow.decription.RightClick" : "Touch and hold the element on which you want to right-click. Touch the free area to close.",
 	"vcmi.tutorialWindow.decription.MapPanning" : "Touch and drag with one finger to move the map.",

+ 30 - 0
Mods/vcmi/Content/config/german.json

@@ -417,6 +417,36 @@
 	"vcmi.battleResultsWindow.spellDurationRemaining.1" : "Verbleibende Dauer: %d Kampfrunde",
 	"vcmi.battleResultsWindow.spellDurationRemaining.2" : "Verbleibende Dauer: %d Kampfrunden",
 
+	"vcmi.credits.website" : "Webseite",
+	"vcmi.credits.vcmi" : "VCMI",
+	"vcmi.credits.heroes" : "Heroes III",
+	"vcmi.credits.idea" : "Idee",
+	"vcmi.credits.developing" : "Entwicklung",
+	"vcmi.credits.testing" : "Tester",
+	"core.credits.createdBy" : "Erstellt von",
+	"core.credits.executiveProducer" : "Ausführender Produzent",
+	"core.credits.producer" : "Produzent",
+	"core.credits.director" : "Regisseur",
+	"core.credits.designers" : "Designer",
+	"core.credits.leadProgrammers" : "Leitende Programmierer",
+	"core.credits.programmers" : "Programmierer",
+	"core.credits.installerProgrammer" : "Installationsprogrammierer",
+	"core.credits.leadArtists" : "Leitende Künstler",
+	"core.credits.artists" : "Künstler",
+	"core.credits.assetCoordinator" : "Asset-Koordinator",
+	"core.credits.levelDesigners" : "Level-Designer",
+	"core.credits.musicProducer" : "Musikproduzent",
+	"core.credits.townThemes" : "Stadtthemen",
+	"core.credits.music" : "Musik",
+	"core.credits.soundDesign" : "Sounddesign",
+	"core.credits.voiceProduction" : "Sprachproduktion",
+	"core.credits.voiceTalent" : "Sprechertalente",
+	"core.credits.leadTester" : "Leitender Tester",
+	"core.credits.seniorTester" : "Senior-Tester",
+	"core.credits.testers" : "Tester",
+	"core.credits.specialThanks" : "Besonderer Dank",
+	"core.credits.visitUsOnTheWeb" : "Besuchen Sie uns im Internet",
+
 	"vcmi.tutorialWindow.title" : "Touchscreen Einführung",
 	"vcmi.tutorialWindow.decription.RightClick" : "Berührt und haltet das Element, auf das mit der rechten Maustaste geklickt werden soll. Berührt den freien Bereich, um zu schließen.",
 	"vcmi.tutorialWindow.decription.MapPanning" : "Berührt und zieht mit einem Finger, um die Karte zu verschieben.",

+ 36 - 3
client/mainmenu/CreditsScreen.cpp

@@ -17,7 +17,9 @@
 #include "../widgets/TextControls.h"
 #include "../widgets/ObjectLists.h"
 
+#include "../../lib/GameLibrary.h"
 #include "../../lib/filesystem/Filesystem.h"
+#include "../../lib/texts/CGeneralTextHandler.h"
 
 #include "../../AUTHORS.h"
 
@@ -36,8 +38,8 @@ CreditsScreen::CreditsScreen(Rect rect)
 	for (auto & element : contributors) 
 	{
 		if(element[0] != contributorsTask)
-			contributorsText += "\r\n{" + element[0] + ":}\r\n";
-		contributorsText += (element[2] != "" ? element[2] : element[1]) + "\r\n";
+			contributorsText += "\r\n\r\n{" + LIBRARY->generaltexth->translate("vcmi.credits." + boost::to_lower_copy(element[0])) + ":}\r\n";
+		contributorsText += (element[1] != "" ? element[1] : element[2]) + "\r\n";
 		contributorsTask = element[0];
 	}
 
@@ -45,7 +47,38 @@ CreditsScreen::CreditsScreen(Rect rect)
 	std::string text((char *)textFile.first.get(), textFile.second);
 	size_t firstQuote = text.find('\"') + 1;
 	text = text.substr(firstQuote, text.find('\"', firstQuote) - firstQuote);
-	text = "{- VCMI -}\r\n\r\n" + contributorsText + "\r\n\r\n{Website:}\r\nhttps://vcmi.eu\r\n\r\n\r\n\r\n\r\n{- Heroes of Might and Magic III -}\r\n\r\n" + text;
+
+	auto translateCredits = [&text](std::map<std::string, std::string> replacements){
+		for(auto & item : replacements)
+			boost::replace_first(text, "{" + item.second + ":}", "{" + LIBRARY->generaltexth->translate(item.first) + ":}");
+	};
+	translateCredits({
+		{ "core.credits.createdBy",           "Created By"           },
+		{ "core.credits.executiveProducer",   "Executive Producer"   },
+		{ "core.credits.producer",            "Producer"             },
+		{ "core.credits.director",            "Director"             },
+		{ "core.credits.designers",           "Designers"            },
+		{ "core.credits.leadProgrammers",     "Lead Programmers"     },
+		{ "core.credits.programmers",         "Programmers"          },
+		{ "core.credits.installerProgrammer", "Installer Programmer" },
+		{ "core.credits.leadArtists",         "Lead Artists"         },
+		{ "core.credits.artists",             "Artists"              },
+		{ "core.credits.assetCoordinator",    "Asset Coordinator"    },
+		{ "core.credits.levelDesigners",      "Level Designers"      },
+		{ "core.credits.musicProducer",       "Music Producer"       },
+		{ "core.credits.townThemes",          "Town Themes"          },
+		{ "core.credits.music",               "Music"                },
+		{ "core.credits.soundDesign",         "Sound Design"         },
+		{ "core.credits.voiceProduction",     "Voice Production"     },
+		{ "core.credits.voiceTalent",         "Voice Talent"         },
+		{ "core.credits.leadTester",          "Lead Tester"          },
+		{ "core.credits.seniorTester",        "Senior Tester"        },
+		{ "core.credits.testers",             "Testers"              },
+		{ "core.credits.specialThanks",       "Special Thanks"       },
+		{ "core.credits.visitUsOnTheWeb",     "Visit us on the Web"  }
+	});
+
+	text = "{- " + LIBRARY->generaltexth->translate("vcmi.credits.vcmi") + " -}\r\n" + contributorsText + "\r\n\r\n{" + LIBRARY->generaltexth->translate("vcmi.credits.website") + ":}\r\nhttps://vcmi.eu\r\n\r\n\r\n\r\n\r\n{- " + LIBRARY->generaltexth->translate("vcmi.credits.heroes") + " -}\r\n\r\n\r\n" + text;
 	credits = std::make_shared<CMultiLineLabel>(Rect(pos.w - 350, 0, 350, 600), FONT_CREDITS, ETextAlignment::CENTER, Colors::WHITE, text);
 	credits->scrollTextTo(-600); // move all text below the screen
 }