Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 372bc1a

Browse files
committed
bug #25249 [Form] Avoid button label translation when it's set to false (TeLiXj)
This PR was submitted for the master branch but it was merged into the 3.4 branch instead (closes #25249). Discussion ---------- [Form] Avoid button label translation when it's set to false | Q | A | ------------- | --- | Branch? | 4.0 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | no | Fixed tickets | | License | MIT | Doc PR | Improve my previous contribution to hide button label when it's set to false (#24148) because a missing translation error appears Commits ------- 368edd8 Avoid button label translation when it's set to false
2 parents de95a37 + 368edd8 commit 372bc1a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,14 @@
216216
{%- endblock range_widget %}
217217

218218
{%- block button_widget -%}
219-
{%- if label is not same as(false) and label is empty -%}
219+
{%- if label is empty -%}
220220
{%- if label_format is not empty -%}
221221
{% set label = label_format|replace({
222222
'%name%': name,
223223
'%id%': id,
224224
}) %}
225+
{%- elseif label is same as(false) -%}
226+
{% set translation_domain = false %}
225227
{%- else -%}
226228
{% set label = name|humanize %}
227229
{%- endif -%}

0 commit comments

Comments
 (0)