Fixed the translation error messages for GraphCanvas
It was unconditionally logging an AZ_Warning and AZ_Error if a translation entry with the same key was added to the database. This didn't account for the same key and value being added to the database, so loading the same translation file twice would result in error messages for each entry. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
This commit is contained in:
@@ -163,9 +163,11 @@ namespace GraphCanvas
|
||||
}
|
||||
else
|
||||
{
|
||||
AZStd::string warning = AZStd::string::format("Unable to store key: %s with value: %s because that key already exists with value: %s", entry.first.c_str(), entry.second.c_str(), m_database[entry.first].c_str());
|
||||
AZ_Warning("TranslationSerializer", false, warning.c_str());
|
||||
warnings = true;
|
||||
const bool valueMatches = entry.second == m_database[entry.first];
|
||||
AZ_Warning("TranslationDatabase", valueMatches,
|
||||
R"(Unable to store key: "%s" with value: "%s" because that key already exists with value: "%s")",
|
||||
entry.first.c_str(), entry.second.c_str(), m_database[entry.first].c_str());
|
||||
warnings = !valueMatches;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user