Skip to content

Commit 31a2674

Browse files
committed
Fixed translation_domain working incorrectly for dropdowns
1 parent 61d3fd6 commit 31a2674

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/bundle/Resources/views/themes/admin/ui/component/dropdown/dropdown.html.twig

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
{% set min_item_width = min_item_width|default(100) %}
1212
{% set custom_form = custom_form is defined ? custom_form : true %}
1313
{% set translation_domain = translation_domain|default(false) %}
14+
{% set choice_translation_domain = choice_translation_domain|default(false) %}
1415
{% set value = value is defined ? value : null %}
1516
{% set multiple = multiple|default(false) %}
1617
{% set no_items = choices_flat|length == 0 %}
@@ -85,7 +86,7 @@
8586

8687
{% include selected_item_template_path with {
8788
value: first_choice.value,
88-
label: _self.get_translated_label(first_choice.label, translation_domain),
89+
label: _self.get_translated_label(first_choice.label, choice_translation_domain),
8990
icon: first_choice.icon is defined ? first_choice.icon,
9091
} %}
9192
{% endif %}
@@ -95,7 +96,7 @@
9596
{% if custom_form ? choice.value == value : choice is selectedchoice(value) %}
9697
{% set label = selected_item_label is defined
9798
? selected_item_label
98-
: _self.get_translated_label(choice.label, translation_domain)
99+
: _self.get_translated_label(choice.label, choice_translation_domain)
99100
%}
100101

101102
{% include selected_item_template_path with {

src/bundle/Resources/views/themes/admin/ui/form_fields/dropdown_widget.html.twig

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
multiple: form.vars.multiple,
1818
custom_init: attr.dropdown_custom_init|default(false),
1919
class: attr.dropdown_class|default(''),
20-
translation_domain: choice_translation_domain|default(false),
20+
choice_translation_domain: choice_translation_domain|default(false),
21+
translation_domain: translation_domain|default(false),
2122
custom_form: false,
2223
is_disabled: attr.disabled|default(false) or disabled|default(false) or dropdown_disabled|default(false),
2324
is_hidden: attr.dropdown_hidden|default(false),

0 commit comments

Comments
 (0)