How to translation "Invalid credentials." error in FOSUserBundle symfony How to translation "Invalid credentials." error in FOSUserBundle symfony symfony symfony

How to translation "Invalid credentials." error in FOSUserBundle symfony


After looking for a while, I found it can help

I looked for where the message came fromץץand i found that this message "Invalid credentials." coming from this path.

vendor\symfony\symfony\src\Symfony\Component\Security\Core\Resources\translations\security.en.xlf

so i copeid the file security.en.xlf into app\Resources\translationsand made some change to the part i wanted to translate

<trans-unit id="4">    <source>Invalid credentials.</source>    <target>Username/password doesn't match</target></trans-unit>


Btw, in my case, I just uncomment the following line in config.yml :

framework:    translator: { fallbacks: ['%locale%'] }

And my locale was set to "fr"

parameters:    locale: fr