1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-02-03 13:01:33 +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

@ -191,6 +191,15 @@
"vcmi.randomMapTab.widgets.teamAlignmentsLabel" : "Team Alignments", "vcmi.randomMapTab.widgets.teamAlignmentsLabel" : "Team Alignments",
"vcmi.randomMapTab.widgets.roadTypesLabel" : "Road Types", "vcmi.randomMapTab.widgets.roadTypesLabel" : "Road Types",
"vcmi.optionsTab.widgets.chessFieldBase.help" : "{Base timer}\n\nCounts down when {turn timer} runs out, never resets. If timer expires, player ends turn.",
"vcmi.optionsTab.widgets.chessFieldTurn.help" : "{Turn timer}\n\nCounts down when player is making turn on adventure map, resets every turn. If {base timer} is enabled, unspent time will be added to it.",
"vcmi.optionsTab.widgets.chessFieldBattle.help" : "{Battle timer}\n\nCounts down during battles when {stack timer} runs out, resets every battle. if timer expires, currently acting stack will defend.",
"vcmi.optionsTab.widgets.chessFieldCreature.help" : "{Creature timer}\n\nCounts down when player is choosing action in battle, resets after each stack turn.",
"vcmi.optionsTab.widgets.labelTimer" : "Timer",
"vcmi.optionsTab.widgets.timerModeSwitch.classic" : "Classic timer",
"vcmi.optionsTab.widgets.timerModeSwitch.chess" : "Chess timer",
// Custom victory conditions for H3 campaigns and HotA maps // Custom victory conditions for H3 campaigns and HotA maps
"vcmi.map.victoryCondition.daysPassed.toOthers" : "The enemy has managed to survive till this day. Victory is theirs!", "vcmi.map.victoryCondition.daysPassed.toOthers" : "The enemy has managed to survive till this day. Victory is theirs!",
"vcmi.map.victoryCondition.daysPassed.toSelf" : "Congratulations! You have managed to survive. Victory is yours!", "vcmi.map.victoryCondition.daysPassed.toSelf" : "Congratulations! You have managed to survive. Victory is yours!",

View File

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