[TwigBridge] Added the translation domain
This commit is contained in:
parent
6e4269f9eb
commit
3aa75828b0
@ -28,13 +28,13 @@
|
|||||||
{% spaceless %}
|
{% spaceless %}
|
||||||
{% for choice, label in options %}
|
{% for choice, label in options %}
|
||||||
{% if _form_is_choice_group(label) %}
|
{% if _form_is_choice_group(label) %}
|
||||||
<optgroup label="{{ choice|trans }}">
|
<optgroup label="{{ choice|trans({}, translation_domain) }}">
|
||||||
{% for nestedChoice, nestedLabel in label %}
|
{% for nestedChoice, nestedLabel in label %}
|
||||||
<option value="{{ nestedChoice }}"{% if _form_is_choice_selected(form, nestedChoice) %} selected="selected"{% endif %}>{{ nestedLabel|trans }}</option>
|
<option value="{{ nestedChoice }}"{% if _form_is_choice_selected(form, nestedChoice) %} selected="selected"{% endif %}>{{ nestedLabel|trans({}, translation_domain) }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</optgroup>
|
</optgroup>
|
||||||
{% else %}
|
{% else %}
|
||||||
<option value="{{ choice }}"{% if _form_is_choice_selected(form, choice) %} selected="selected"{% endif %}>{{ label|trans }}</option>
|
<option value="{{ choice }}"{% if _form_is_choice_selected(form, choice) %} selected="selected"{% endif %}>{{ label|trans({}, translation_domain) }}</option>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endspaceless %}
|
{% endspaceless %}
|
||||||
@ -52,7 +52,7 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<select {{ block('widget_attributes') }}{% if multiple %} multiple="multiple"{% endif %}>
|
<select {{ block('widget_attributes') }}{% if multiple %} multiple="multiple"{% endif %}>
|
||||||
{% if empty_value is not none %}
|
{% if empty_value is not none %}
|
||||||
<option value="">{{ empty_value|trans }}</option>
|
<option value="">{{ empty_value|trans({}, translation_domain) }}</option>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if preferred_choices|length > 0 %}
|
{% if preferred_choices|length > 0 %}
|
||||||
{% set options = preferred_choices %}
|
{% set options = preferred_choices %}
|
||||||
@ -198,7 +198,7 @@
|
|||||||
{% if required %}
|
{% if required %}
|
||||||
{% set attr = attr|merge({'class': attr.class|default('') ~ ' required'}) %}
|
{% set attr = attr|merge({'class': attr.class|default('') ~ ' required'}) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<label{% for attrname,attrvalue in attr %} {{attrname}}="{{attrvalue}}"{% endfor %}>{{ label|trans }}</label>
|
<label{% for attrname,attrvalue in attr %} {{attrname}}="{{attrvalue}}"{% endfor %}>{{ label|trans({}, translation_domain) }}</label>
|
||||||
{% endspaceless %}
|
{% endspaceless %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user