From af3bba8de1d3344a957d432f101434356c53d8a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Poirier=20Th=C3=A9or=C3=AAt?= Date: Fri, 3 May 2024 15:47:17 -0400 Subject: [PATCH] [SonataExtradBundle] translate show grid column name --- .../Resources/views/CRUD/show_grid.html.twig | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/sonata-extra-bundle/Resources/views/CRUD/show_grid.html.twig b/packages/sonata-extra-bundle/Resources/views/CRUD/show_grid.html.twig index 836ad474d..11901b830 100644 --- a/packages/sonata-extra-bundle/Resources/views/CRUD/show_grid.html.twig +++ b/packages/sonata-extra-bundle/Resources/views/CRUD/show_grid.html.twig @@ -12,7 +12,17 @@ {% for field in field_description.options.fields %} {% if field.type != 'grid' %} {% set colCount = colCount +1 %} - {{ field.label }} + + {% apply spaceless %} + {% if field.label is not same as(false) %} + {% if field.translationDomain is same as(false) %} + {{ field.label }} + {% else %} + {{ field.label|trans({}, field.translationDomain) }} + {% endif %} + {% endif %} + {% endapply %} + {% endif %} {% endfor %}