1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Introduced string identifiers for H3 texts, still WIP

This commit is contained in:
Ivan Savenko
2022-12-27 22:19:05 +02:00
parent 71bedf130f
commit bdb8e0ee5c
24 changed files with 387 additions and 314 deletions

View File

@@ -92,19 +92,10 @@ std::string InterfaceObjectConfigurable::readText(const JsonNode & config) const
const std::string delimiter = "/";
std::string s = config.String();
boost::replace_all(s, "/", "." );
logGlobal->debug("Reading text from translations by key: %s", s);
JsonNode translated = CGI->generaltexth->localizedTexts;
for(size_t p = s.find(delimiter); p != std::string::npos; p = s.find(delimiter))
{
translated = translated[s.substr(0, p)];
s.erase(0, p + delimiter.length());
}
if(s == config.String())
{
logGlobal->warn("Reading non-translated text: %s", s);
return s;
}
return translated[s].String();
return CGI->generaltexth->translate(s);
}
Point InterfaceObjectConfigurable::readPosition(const JsonNode & config) const