Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FOSUserBundle doesn't translate with trans_default_domain

I am setting up FOSUserBundle dev-master with Symfony 2.3 RC1 but translation is not working well. It comes by default with trans_default_domain in the templates

In the login template. It doesn't with trans_default_domain

{% trans_default_domain "FOSUserBundle" %}
<label class="control-label" for="username">{{ 'security.login.username'|trans }}</label>

but using trans({}, 'FOSUserBundle') It works

<label class="control-label" for="username">{{ 'security.login.username'|trans({}, 'FOSUserBundle') }}</label>

What's wrong with trans_default_domain? need any extra config?

like image 917
dextervip Avatar asked Dec 11 '22 14:12

dextervip


1 Answers

Try to enable the symfony translation component. By default it is commented out:

# app/config/config.yml
framework:
    translator: { fallback: en }

http://symfony.com/doc/current/book/translation.html#configuration

like image 200
Aris Avatar answered Jan 18 '23 07:01

Aris