1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Added 'translate missing' command for convenience

This commit is contained in:
Ivan Savenko
2024-10-26 11:50:08 +00:00
parent e5739e49da
commit 565c02d61c
7 changed files with 32 additions and 16 deletions

View File

@@ -185,12 +185,12 @@ void ClientCommandManager::handleRedrawCommand()
GH.windows().totalRedraw();
}
void ClientCommandManager::handleTranslateGameCommand()
void ClientCommandManager::handleTranslateGameCommand(bool onlyMissing)
{
std::map<std::string, std::map<std::string, std::string>> textsByMod;
VLC->generaltexth->exportAllTexts(textsByMod);
VLC->generaltexth->exportAllTexts(textsByMod, onlyMissing);
const boost::filesystem::path outPath = VCMIDirs::get().userExtractedPath() / "translation";
const boost::filesystem::path outPath = VCMIDirs::get().userExtractedPath() / ( onlyMissing ? "translationMissing" : "translation");
boost::filesystem::create_directories(outPath);
for(const auto & modEntry : textsByMod)
@@ -267,7 +267,7 @@ void ClientCommandManager::handleTranslateMapsCommand()
}
std::map<std::string, std::map<std::string, std::string>> textsByMod;
VLC->generaltexth->exportAllTexts(textsByMod);
VLC->generaltexth->exportAllTexts(textsByMod, false);
const boost::filesystem::path outPath = VCMIDirs::get().userExtractedPath() / "translation";
boost::filesystem::create_directories(outPath);
@@ -598,7 +598,10 @@ void ClientCommandManager::processCommand(const std::string & message, bool call
handleRedrawCommand();
else if(message=="translate" || message=="translate game")
handleTranslateGameCommand();
handleTranslateGameCommand(false);
else if(message=="translate missing")
handleTranslateGameCommand(true);
else if(message=="translate maps")
handleTranslateMapsCommand();