How can i translate the entire block in the parent template page.html.twig:
{# app/Resources/views/page.html.twig #}
{% extends '::bootstrap.html.twig' %}
{% block page %}
<div class="page-header">
<h1>{% block header %}{% endblock %}
<small>{% block small %}{% endblock %}</small></h1>
</div>
<div id="content" class="container-fluid">
{% block content %}{% endblock %}
</div>
{% endblock %}
… instead of calling trans in each child template?
{# src/AcmeHelloBundle/Resources/views/User/show.html.twig #}
{% extends '::page.html.twig' %}
{% block header %}{% trans %}Utente{% endtrans %}{% endblock %}
{% block small %}{% trans %}dettaglio{% endtrans %}{% endblock %}
{% block content %}{% endblock %}
I’ve tried surround {% block header %} with {% trans %} but it complains about trans that should be a simple string and not an expression.
Nevermind. Found it by myself using
blockdirectly:I’m not going to delete the question since i can’t find any similar…