Like translating "Invalid credentials." Error in FOSUserBundle symfony

I have this piece of code in the login.html.twig page

I want to translate the "Invalid credentials" error message.

 {% if error %}
     <div style="color:red">
         {{ error.messageKey|trans(error.messageData, 'security') }}
     </div>
 {% endif %}

Now, I'm trying to translate into messages.en.yml or FOSUserBundle.en.yml, and nothing happens. (using symfony3)

+4
source share
1 answer

Trying to find some time, I found that it can help

I searched for where the message came from ץץ and I found that this message is "Invalid credentials". proceeding from this way.

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

security.en.xlf \\ ,

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

All Articles