Use existing 'no such field' tr string

This commit is contained in:
RumovZ 2021-07-29 08:30:49 +02:00
parent d6e5f3c67c
commit d090bd7e21
2 changed files with 1 additions and 4 deletions

View File

@ -21,9 +21,6 @@ card-template-rendering-conditional-not-open = Found '{ $found }', but missing '
# when the user referenced a field that doesn't exist
# eg, Found '{{Field}}', but there is not field called 'Field'
card-template-rendering-no-such-field = Found '{ $found }', but there is no field called '{ $field }'
# when the user referenced a field that doesn't exist in a conditional, excepting card numbers like 'c1'
# eg, Found '{{#Field}}', but neither is it a card number nor is there a field called 'Field'
card-template-rendering-no-such-conditional = Found '{ $found }', but neither is it a card number nor is there a field called '{ $key }'
# This message is shown when the front side of the card is blank,
# either due to a badly-designed template, or because required fields
# are missing.

View File

@ -298,7 +298,7 @@ fn localized_template_error(tr: &I18n, err: TemplateError) -> String {
.card_template_rendering_no_such_field(format!("{{{{{}{}}}}}", filters, field), field)
.into(),
TemplateError::NoSuchConditional(condition) => tr
.card_template_rendering_no_such_conditional(
.card_template_rendering_no_such_field(
format!("{{{{{}}}}}", condition),
&condition[1..],
)