Closed mazsudo closed 3 years ago
Seems the problem is related to the fact that
does not translate the key. It may be related to this sonata-project/SonataAdminBundle#6082 where something actually translated this key. So I don't know if we should inject Translator inside LoginAction to translate this key
I would say it's 100% related.
The code should be now
$this->session->getFlashBag()->add('sonata_user_error', $this->translator('sonata_user_already_authenticated', [], 'theRightDomain'));
Could you provide a PR ?
thx for your reply @VincentLanglet. will do surely!
Environment
Sonata packages
Symfony packages
PHP version
Subject
Translation key sonata_user_already_authenticated in flash message isn't translated anymore
Steps to reproduce
login once, then return on /login, flash message will appear with sonata_user_already_authenticated untranslated
Expected results
sonata_user_already_authenticated translated
Actual results
sonata_user_already_authenticated untranslated
Seems the problem is related to the fact that https://github.com/sonata-project/SonataUserBundle/blob/dac06cf40559192197f48a20bb0eb1dc19f87abb/src/Action/LoginAction.php#L94 does not translate the key. It may be related to this https://github.com/sonata-project/SonataAdminBundle/issues/6082 where something actually translated this key. So I don't know if we should inject Translator inside LoginAction to translate this key