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
+4
View File
@@ -810,6 +810,10 @@ error:
can't write image to set: Failed to write image to set: '%s'
can't import image: Failed to import image: '%s'
# Card creation
no field with name: Card doesn't have a field named '%s'
can't set value: Can not set card value '%s', it is not of the right type
# Script stuff
has no member: %s has no member '%s'
can't convert: Can't convert from %s to %s
+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);