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

python - No exponential form of the z-axis in matplotlib-3D-plots -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -

Why does a .NET 4.0 program produce a system.unauthorizedAccess error on a Windows Server 2012 machine with .NET 4.5 installed? -