localize pattern in new_card

This commit is contained in:
GenevensiS
2025-04-11 03:48:18 +02:00
parent 1a3940c16d
commit 91433d5c9d
2 changed files with 6 additions and 2 deletions
+2 -2
View File
@@ -34,7 +34,7 @@ SCRIPT_FUNCTION(new_card) {
// find value to update
IndexMap<FieldP,ValueP>::const_iterator value_it = new_card->data.find(name);
if (value_it == new_card->data.end()) {
throw ScriptError(format_string(_("Card doesn't have a field named '%s'"),name));
throw ScriptError(_ERROR_1_("no field with name", name));
}
Value* value = value_it->get();
// set the value
@@ -50,7 +50,7 @@ SCRIPT_FUNCTION(new_card) {
wxFileName fname( static_cast<ExternalImage*>(v.get())->toString() );
ivalue->filename = LocalFileName::fromReadString( fname.GetName(), "");
} else {
throw ScriptError(format_string(_("Can not set value '%s', it is not of the right type"),name));
throw ScriptError(_ERROR_1_("can't set value", name));
}
}
SCRIPT_RETURN(new_card);