I'm working on a Symfony2 project and have a question from it. In one twig template I receive a variable from controller. It's a string and I need to translate it. But the syntax
{% trans %}{{ post['name'] }}{% endtrans %}
returns error "A message must be a simple text in...".
So is there a way to translate the variable values???
Use filters:
{{ post['name']|trans }}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With