123qwe
123qwe

Reputation: 1585

Symfony 2.6 - Translation does not work

I've installed fresh symfony2, and I tried to translate text, but in debug:translation, ids are duplicated, and twig output shows me Id, not Message Preview text. What is wrong?

app/console debug:translation output:

+----------+-----------+----------------------+
| State(s) | Id        | Message Preview (en) |
+----------+-----------+----------------------+
| x        | base.test | base.test            |
| o        | base.test | This is test         |
+----------+-----------+----------------------+

twig input:

{% trans %}base.test{% endtrans %}

twig output:

base.test

base.en.yml:

base.test: This is test

Upvotes: 0

Views: 280

Answers (1)

Ulti
Ulti

Reputation: 608

You need to define the translation domain.

{% trans from "base" %}base.test{% endtrans %}

And configure your config.yml :

framework
    translator: { fallback: en }

Upvotes: 3

Related Questions