- improved error reporting for badly defined translations.
This needs to be handled by the caller for all use cases because the translation parser lacks the context to do a proper error report.
This commit is contained in:
parent
a96b86b13b
commit
a38e75db00
4 changed files with 148 additions and 136 deletions
|
|
@ -729,7 +729,6 @@ DEFINE_PROPERTY(translation, L, Actor)
|
|||
else
|
||||
{
|
||||
FRemapTable CurrentTranslation;
|
||||
bool success = true;
|
||||
|
||||
CurrentTranslation.MakeIdentity();
|
||||
for(int i = 1; i < PROP_PARM_COUNT; i++)
|
||||
|
|
@ -744,14 +743,17 @@ DEFINE_PROPERTY(translation, L, Actor)
|
|||
else
|
||||
{
|
||||
// parse all ranges to get a complete list of errors, if more than one range fails.
|
||||
success |= CurrentTranslation.AddToTranslation(str);
|
||||
try
|
||||
{
|
||||
CurrentTranslation.AddToTranslation(str);
|
||||
}
|
||||
catch (CRecoverableError &err)
|
||||
{
|
||||
bag.ScriptPosition.Message(MSG_WARNING, "Error in translation '%s':\n" TEXTCOLOR_CYAN "%s\n", str, err.GetMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
defaults->Translation = CurrentTranslation.StoreTranslation (TRANSLATION_Decorate);
|
||||
if (!success)
|
||||
{
|
||||
bag.ScriptPosition.Message(MSG_WARNING, "Failed to parse translation");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue