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

Inspector widgets set string ID

This commit is contained in:
nordsoft
2023-09-28 14:03:58 +02:00
parent 232b3e8cf6
commit 60df49236f
3 changed files with 36 additions and 27 deletions

View File

@ -301,26 +301,17 @@ void TextLocalizationContainer::registerString(const std::string & modContext, c
if(stringsLocalizations.count(UID.get()) > 0)
{
auto & value = stringsLocalizations[UID.get()];
if(value.baseLanguage.empty())
{
value.baseLanguage = language;
value.baseValue = localized;
}
else
{
if(value.baseValue != localized)
logMod->warn("Duplicate registered string '%s' found! Old value: '%s', new value: '%s'", UID.get(), value.baseValue, localized);
}
value.baseLanguage = language;
value.baseValue = localized;
}
else
{
StringState result;
result.baseLanguage = language;
result.baseValue = localized;
result.modContext = modContext;
StringState value;
value.baseLanguage = language;
value.baseValue = localized;
value.modContext = modContext;
stringsLocalizations[UID.get()] = result;
stringsLocalizations[UID.get()] = value;
}
}