I am using the FOSUserBundle login form and I would like to translate error messages. These messages run here: vendor / symfony / src / Symfony / Component / Security / Core / Authentication / Provider / DaoAuthenticationProvider.php
protected function checkAuthentication(UserInterface $user, UsernamePasswordToken $token) { $currentUser = $token->getUser(); if ($currentUser instanceof UserInterface) { if ($currentUser->getPassword() !== $user->getPassword()) { throw new BadCredentialsException('The credentials were changed from another session.'); } } else { if (!$presentedPassword = $token->getCredentials()) { throw new BadCredentialsException('The presented password cannot be empty.'); } if (!$this->encoderFactory->getEncoder($user)->isPasswordValid($user->getPassword(), $presentedPassword, $user->getSalt())) { throw new BadCredentialsException('The presented password is invalid.'); } } }
I am writing an application /Resources/translations/validators.fr.yml
"The presented password cannot be empty.": "Veuillez saisir un mot de passe."
I am writing an application /Resources/translations/messages.fr.yml
"The presented password cannot be empty.": "Veuillez saisir un mot de passe."
But that will not work. Another translation works (=> fr), but I have a problem with these messages.
Special procedure for these messages?
symfony translation
bux
source share