diff --git a/mapeditor/mapsettings/loseconditions.cpp b/mapeditor/mapsettings/loseconditions.cpp index c66c0f936..3e155060d 100644 --- a/mapeditor/mapsettings/loseconditions.cpp +++ b/mapeditor/mapsettings/loseconditions.cpp @@ -117,7 +117,7 @@ void LoseConditions::initialize(MapController & c) void LoseConditions::update() { //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 EventCondition defeatCondition(EventCondition::DAYS_WITHOUT_TOWN); diff --git a/mapeditor/mapsettings/translations.cpp b/mapeditor/mapsettings/translations.cpp index ab8a76bcc..5088bc4c3 100644 --- a/mapeditor/mapsettings/translations.cpp +++ b/mapeditor/mapsettings/translations.cpp @@ -17,7 +17,7 @@ void Translations::cleanupRemovedItems(CMap & map) { - std::set existingObjects; + std::set existingObjects{"core", "map", "header"}; for(auto object : map.objects) existingObjects.insert(object->instanceName); @@ -28,7 +28,7 @@ void Translations::cleanupRemovedItems(CMap & map) { 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; break; diff --git a/mapeditor/mapsettings/victoryconditions.cpp b/mapeditor/mapsettings/victoryconditions.cpp index 248b637e1..43131386b 100644 --- a/mapeditor/mapsettings/victoryconditions.cpp +++ b/mapeditor/mapsettings/victoryconditions.cpp @@ -179,7 +179,7 @@ void VictoryConditions::initialize(MapController & c) void VictoryConditions::update() { //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 EventCondition victoryCondition(EventCondition::STANDARD_WIN);