1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Translations bugfixes

This commit is contained in:
nordsoft 2023-10-05 22:54:28 +02:00
parent 2e3e116bc4
commit 189f790b44
3 changed files with 4 additions and 4 deletions

View File

@ -117,7 +117,7 @@ void LoseConditions::initialize(MapController & c)
void LoseConditions::update() void LoseConditions::update()
{ {
//loss messages //loss messages
controller->map()->defeatMessage = MetaString::createFromRawString(ui->defeatMessageEdit->text().toStdString()); controller->map()->defeatMessage = MetaString::createFromTextID(mapRegisterLocalizedString("map", *controller->map(), TextIdentifier("header", "defeatMessage"), ui->defeatMessageEdit->text().toStdString()));
//loss conditions //loss conditions
EventCondition defeatCondition(EventCondition::DAYS_WITHOUT_TOWN); EventCondition defeatCondition(EventCondition::DAYS_WITHOUT_TOWN);

View File

@ -17,7 +17,7 @@
void Translations::cleanupRemovedItems(CMap & map) void Translations::cleanupRemovedItems(CMap & map)
{ {
std::set<std::string> existingObjects; std::set<std::string> existingObjects{"core", "map", "header"};
for(auto object : map.objects) for(auto object : map.objects)
existingObjects.insert(object->instanceName); existingObjects.insert(object->instanceName);
@ -28,7 +28,7 @@ void Translations::cleanupRemovedItems(CMap & map)
{ {
for(auto part : QString::fromStdString(s.first).split('.')) for(auto part : QString::fromStdString(s.first).split('.'))
{ {
if(part == "map" || existingObjects.count(part.toStdString())) if(existingObjects.count(part.toStdString()))
{ {
updateTranslations.Struct()[s.first] = s.second; updateTranslations.Struct()[s.first] = s.second;
break; break;

View File

@ -179,7 +179,7 @@ void VictoryConditions::initialize(MapController & c)
void VictoryConditions::update() void VictoryConditions::update()
{ {
//victory messages //victory messages
controller->map()->victoryMessage = MetaString::createFromRawString(ui->victoryMessageEdit->text().toStdString()); controller->map()->victoryMessage = MetaString::createFromTextID(mapRegisterLocalizedString("map", *controller->map(), TextIdentifier("header", "victoryMessage"), ui->victoryMessageEdit->text().toStdString()));
//victory conditions //victory conditions
EventCondition victoryCondition(EventCondition::STANDARD_WIN); EventCondition victoryCondition(EventCondition::STANDARD_WIN);