1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-17 00:07:41 +02:00

Implemented translations for H3M maps

This commit is contained in:
Ivan Savenko
2023-02-25 17:44:15 +02:00
parent 5b767d8b0d
commit 260f6d626c
10 changed files with 110 additions and 69 deletions

View File

@ -257,7 +257,17 @@ const std::string & CGeneralTextHandler::deserialize(const TextIdentifier & iden
void CGeneralTextHandler::registerString(const std::string & modContext, const TextIdentifier & UID, const std::string & localized)
{
assert(UID.get().find("..") == std::string::npos); // invalid identifier - there is section that was evaluated to empty string
assert(stringsLocalizations.count(UID.get()) == 0); // registering already registered string?
//assert(stringsLocalizations.count(UID.get()) == 0); // registering already registered string?
if (stringsLocalizations.count(UID.get()) > 0)
{
std::string oldValue = stringsLocalizations[UID.get()].baseValue;
if (oldValue != localized)
logMod->warn("Duplicate registered string '%s' found! Old value: '%s', new value: '%s'", UID.get(), oldValue, localized);
return;
}
assert(!modContext.empty());
assert(!getModLanguage(modContext).empty());