Reputation: 4672
I've override FosUser profile templates in app/Resources/FosUserBundle
Every thing is ok but translations not working!.
example:
in app/Resources/translations/messages.en.yml
:
foo.bar: baz
in app/Resources/FosUserBundle/views/Profile/show_contect.html.twig
{{ 'foo.bar' | trans }} --> output: foo.bar
and there is no problem with locale: app.request.locale
--> en
$ php bin/console debug:translation en
Upvotes: 3
Views: 2234
Reputation: 4244
As is stated in documentation, you should place translation messages file messages.en.yml
in folder app/Resources/FOSUserBundle/translations/
.
Upvotes: 0
Reputation: 39430
Has suggested by @gp_sflover symfony is not using the default messages catalog for manage the template, so you can add the new files FOSUserBundle.en.yml
with the translation of force the trans filter to use the messages
catalog as follow:
{{ 'foo.bar' | |trans({}, 'messages') }}
Hope this help
Upvotes: 4