symfony - Translations doesn't work -


i'm using symfony2.6 , catalogue of translation doesn't work

message.en.yml

#src/appbundle/resources/translations/message.en.yml app:     menu:         home: home 

message.fr.yml

#src/appbundle/resources/translations/message.fr.yml app:     menu:         home: accueil 

and twig

{{ 'app.menu.home'|trans }} 

this output

app.menu.home 

your translation namespace not correct (the final s of message missing), files should named:

#src/appbundle/resources/translations/messages.en.yml #src/appbundle/resources/translations/messages.fr.yml 

or call trans helper message namespace:

{{ 'app.menu.home'|trans({},'message') } 

Comments

Popular posts from this blog

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

php - Using str_replace to translate a MySQL Table in html -

asp.net mvc - Cannot display error message on Editor or EditorFor -