When I was doing plain PHP, I was simply doing this:
printf(_("Hello %s !"), $name);
Now with Twig, I must use the trans tag. So I've copy/paste the documentation example, and here's my full template:
{% extends 'MyAppBundle::layout.html.twig' %}
{% block content %}
<h1>
{% trans %}
Hello {{ name }}!
{% endtrans %}
</h1>
{% endblock %}
Why Symfony return the following exeption ?
See Question&Answers more detail:osA message must be a simple text in "MyAppBundle::home.html.twig"
500 Internal Server Error - Twig_Error_Syntax