You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ...
$form['name']->addError($this->translator->translate('myError', ['errorType' => 'something']));
my admin.en.neon:
forms:
myError: "This is %errorType%."
Latte:
<div n:foreach="$form['name']->errors as $error">{$error}</div>
This "constellation" returns: "This is %errorType%."
BUT when I change $form['name']->addError($this->translator->translate('myError', ['errorType' => 'something']));
to $form['name']->addError($this->translator->translate('admin.forms.myError', ['errorType' => 'something']));
it returns: "This is something."
So it translates even without full path, but it does not replace the parameters. When full path is provided, it replace the parameter correctly.
Maybe, there should be always full path (admin.forms.myError) in translate method, but why it translate it even without the full path, but does not replace the parameters?
(maybe there can be used {translator ...} tag somewhere in the latte file, but I am not sure how exactly it affect this)
The text was updated successfully, but these errors were encountered:
I have a form with:
When the form is processed, I have:
my admin.en.neon:
Latte:
<div n:foreach="$form['name']->errors as $error">{$error}</div>
This "constellation" returns: "This is %errorType%."
BUT when I change
$form['name']->addError($this->translator->translate('myError', ['errorType' => 'something']));
to
$form['name']->addError($this->translator->translate('admin.forms.myError', ['errorType' => 'something']));
it returns: "This is something."
So it translates even without full path, but it does not replace the parameters. When full path is provided, it replace the parameter correctly.
Maybe, there should be always full path (admin.forms.myError) in translate method, but why it translate it even without the full path, but does not replace the parameters?
(maybe there can be used {translator ...} tag somewhere in the latte file, but I am not sure how exactly it affect this)
The text was updated successfully, but these errors were encountered: