The text message using addFlash is translated in the "messages" domain, not the Admin domain.
public function configureDashboard(): Dashboard
{
return Dashboard::new()
->setTranslationDomain('admin')
;
}
$this->addFlash('danger', 'Changing the work schedule is not allowed.');
I think that https://github.com/EasyCorp/EasyAdminBundle/blob/4.x/templates/flash_messages.html.twig the trans_default_domain isn't working as expected because twig component <twig:ea:Alert> isn't "aware" of the context.
Easy fix:
{% with { translatedMessage: message|trans } %}
<twig:ea:Alert variant="{{ label }}" withDismissButton>
{{ translatedMessage|raw }}
</twig:ea:Alert>
{% endwith %}