|
28 | 28 | {% spaceless %}
|
29 | 29 | {% for choice, label in options %}
|
30 | 30 | {% if _form_is_choice_group(label) %}
|
31 |
| - <optgroup label="{{ choice|trans }}"> |
| 31 | + <optgroup label="{{ choice|trans({}, translation_domain) }}"> |
32 | 32 | {% for nestedChoice, nestedLabel in label %}
|
33 |
| - <option value="{{ nestedChoice }}"{% if _form_is_choice_selected(form, nestedChoice) %} selected="selected"{% endif %}>{{ nestedLabel|trans }}</option> |
| 33 | + <option value="{{ nestedChoice }}"{% if _form_is_choice_selected(form, nestedChoice) %} selected="selected"{% endif %}>{{ nestedLabel|trans({}, translation_domain) }}</option> |
34 | 34 | {% endfor %}
|
35 | 35 | </optgroup>
|
36 | 36 | {% else %}
|
37 |
| - <option value="{{ choice }}"{% if _form_is_choice_selected(form, choice) %} selected="selected"{% endif %}>{{ label|trans }}</option> |
| 37 | + <option value="{{ choice }}"{% if _form_is_choice_selected(form, choice) %} selected="selected"{% endif %}>{{ label|trans({}, translation_domain) }}</option> |
38 | 38 | {% endif %}
|
39 | 39 | {% endfor %}
|
40 | 40 | {% endspaceless %}
|
|
52 | 52 | {% else %}
|
53 | 53 | <select {{ block('widget_attributes') }}{% if multiple %} multiple="multiple"{% endif %}>
|
54 | 54 | {% if empty_value is not none %}
|
55 |
| - <option value="">{{ empty_value|trans }}</option> |
| 55 | + <option value="">{{ empty_value|trans({}, translation_domain) }}</option> |
56 | 56 | {% endif %}
|
57 | 57 | {% if preferred_choices|length > 0 %}
|
58 | 58 | {% set options = preferred_choices %}
|
|
198 | 198 | {% if required %}
|
199 | 199 | {% set attr = attr|merge({'class': attr.class|default('') ~ ' required'}) %}
|
200 | 200 | {% endif %}
|
201 |
| - <label{% for attrname,attrvalue in attr %} {{attrname}}="{{attrvalue}}"{% endfor %}>{{ label|trans }}</label> |
| 201 | + <label{% for attrname,attrvalue in attr %} {{attrname}}="{{attrvalue}}"{% endfor %}>{{ label|trans({}, translation_domain) }}</label> |
202 | 202 | {% endspaceless %}
|
203 | 203 | {% endblock %}
|
204 | 204 |
|
|
0 commit comments