FOSUserBundle 로그인 양식을 사용하고 있으며 오류 메시지를 번역하고 싶습니다. 이러한 메시지는 여기에서 시작됩니다 공급 업체/심포니/SRC/심포니/컴포넌트/보안/코어/인증/제공/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.');
}
}
}
내가 작성했습니다 응용 프로그램/자원/번역/validators.fr .yml
"The presented password cannot be empty.": "Veuillez saisir un mot de passe."
내가 응용 프로그램/자원/번역/messages.fr.yml
"The presented password cannot be empty.": "Veuillez saisir un mot de passe."
,691 쓰기했습니다
하지만 작동하지 않습니다. 다른 번역이 작동하지만 (=> fr),이 메시지에 문제가 있습니다.
이러한 메시지에 대한 특수 절차는 무엇입니까?
비슷한 방법을 사용했습니다 : 오류를 잡아서 trans로 나뭇 가지에 표시하십시오. . – bux