Skip to content

Commit e322b94

Browse files
author
Florian Eckerstorfer
committed
Merge pull request #382 from Restless-ET/patch-1
Use 'choice_translation_domain' option
2 parents ad5ee4d + 2475381 commit e322b94

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Resources/views/Form/bootstrap.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,12 @@
217217
{% spaceless %}
218218
{% for group_label, choice in options %}
219219
{% if choice is iterable %}
220-
<optgroup label="{{ group_label|trans({}, translation_domain) }}">
220+
<optgroup label="{{ choice_translation_domain is defined ? (choice_translation_domain is sameas(false) ? group_label : group_label|trans({}, choice_translation_domain)) : group_label|trans({}, translation_domain) }}">
221221
{% set options = choice %}
222222
{{ block('choice_widget_options') }}
223223
</optgroup>
224224
{% else %}
225-
<option value="{{ choice.value }}"{% if choice is selectedchoice(value) %} selected="selected"{% endif %}>{{ choice.label|trans({}, translation_domain) }}</option>
225+
<option value="{{ choice.value }}"{% if choice is selectedchoice(value) %} selected="selected"{% endif %}>{{ choice_translation_domain is defined ? (choice_translation_domain is sameas(false) ? choice.label : choice.label|trans({}, choice_translation_domain)) : choice.label|trans({}, translation_domain) }}</option>
226226
{% endif %}
227227
{% endfor %}
228228
{% endspaceless %}

0 commit comments

Comments
 (0)