PHP Code:
\Espo\Core\Exceptions\Error::createWithBody(
'some-reason',
\Espo\Core\Exceptions\Error\Body::create()
->withMessageTranslation('someTranslationKey', null, [
'placeholder' => 'value',
])
->encode()
);
Translation path in a language file: messages > someTranslationKey.
This exception will be translated in the front-end.
{placeholder} will be replaced with 'value'.

Leave a comment: