Allow trans filter to be safe

This commit is contained in:
Mathieu Lechat 2018-01-10 13:22:09 +01:00
parent 1b92f0685d
commit 041c42db6a

View File

@ -219,7 +219,13 @@
{% set label = name|humanize %}
{%- endif -%}
{%- endif -%}
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}</label>
<label{% for attrname, attrvalue in label_attr %} {{ attrname }}="{{ attrvalue }}"{% endfor %}>
{%- if translation_domain is same as(false) -%}
{{- label -}}
{%- else -%}
{{- label|trans({}, translation_domain) -}}
{%- endif -%}
</label>
{%- endif -%}
{%- endblock form_label -%}