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

Viewed 5682

I have this part of code in login.html.twig page

I want to translate error message "Invalid credentials."

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

now, i'm trying to translat in messages.en.yml or in FOSUserBundle.en.yml and nothing happen. (using symfony3)

3 Answers

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
Related