[TwigBridge] button_widget now has its title attr translated even if its label = null or false

This commit is contained in:
Stephen Lewis 2020-01-03 11:56:12 +00:00 committed by Fabien Potencier
parent 8e9aafc84f
commit 2a5d9cb75a
1 changed files with 2 additions and 4 deletions

View File

@ -222,13 +222,11 @@
'%name%': name,
'%id%': id,
}) %}
{%- elseif label is same as(false) -%}
{% set translation_domain = false %}
{%- else -%}
{%- elseif label is not same as(false) -%}
{% set label = name|humanize %}
{%- endif -%}
{%- endif -%}
<button type="{{ type|default('button') }}" {{ block('button_attributes') }}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}</button>
<button type="{{ type|default('button') }}" {{ block('button_attributes') }}>{{ translation_domain is same as(false) or label is same as(false) ? label : label|trans({}, translation_domain) }}</button>
{%- endblock button_widget -%}
{%- block submit_widget -%}