1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-03 00:46:55 +02:00

Translations for turn timers

This commit is contained in:
nordsoft
2023-08-29 14:53:15 +04:00
parent 883c68b151
commit c8243313b8
2 changed files with 13 additions and 2 deletions

View File

@ -157,6 +157,8 @@ std::string InterfaceObjectConfigurable::readText(const JsonNode & config) const
return "";
std::string s = config.String();
if(s.empty())
return s;
logGlobal->debug("Reading text from translations by key: %s", s);
return CGI->generaltexth->translate(s);
}
@ -561,8 +563,8 @@ std::shared_ptr<CTextInput> InterfaceObjectConfigurable::buildTextInput(const Js
result->font = readFont(config["font"]);
if(!config["color"].isNull())
result->setColor(readColor(config["color"]));
if(!config["text"].isNull())
result->setText(readText(config["text"]));
if(!config["text"].isNull() && config["text"].isString())
result->setText(config["text"].String()); //for input field raw string is taken
if(!config["callback"].isNull())
result->cb += callbacks_string.at(config["callback"].String());
if(!config["help"].isNull())