From cb500e62a82b7fdf9c5d887db7ddf209f3c9790b Mon Sep 17 00:00:00 2001 From: TeLiXj Date: Fri, 1 Dec 2017 14:56:56 +0100 Subject: [PATCH] Avoid button label translation when it's set to false Improve my previous contribution to hide button label when it's set to false (#24148) because a missing translation error appear --- .../Twig/Resources/views/Form/form_div_layout.html.twig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig b/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig index 52525c061ccba..db3dfe603f7b6 100644 --- a/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig +++ b/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig @@ -216,12 +216,14 @@ {%- endblock range_widget %} {%- block button_widget -%} - {%- if label is not same as(false) and label is empty -%} + {%- if label is empty -%} {%- if label_format is not empty -%} {% set label = label_format|replace({ '%name%': name, '%id%': id, }) %} + {%- elseif label is same as(false) -%} + {% set translation_domain = false %} {%- else -%} {% set label = name|humanize %} {%- endif -%}