Skip to content

Commit

Permalink
Fixed translation_domain working incorrectly for dropdowns
Browse files Browse the repository at this point in the history
  • Loading branch information
Steveb-p committed Jul 2, 2024
1 parent 61d3fd6 commit 31a2674
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
{% set min_item_width = min_item_width|default(100) %}
{% set custom_form = custom_form is defined ? custom_form : true %}
{% set translation_domain = translation_domain|default(false) %}
{% set choice_translation_domain = choice_translation_domain|default(false) %}
{% set value = value is defined ? value : null %}
{% set multiple = multiple|default(false) %}
{% set no_items = choices_flat|length == 0 %}
Expand Down Expand Up @@ -85,7 +86,7 @@

{% include selected_item_template_path with {
value: first_choice.value,
label: _self.get_translated_label(first_choice.label, translation_domain),
label: _self.get_translated_label(first_choice.label, choice_translation_domain),
icon: first_choice.icon is defined ? first_choice.icon,
} %}
{% endif %}
Expand All @@ -95,7 +96,7 @@
{% if custom_form ? choice.value == value : choice is selectedchoice(value) %}
{% set label = selected_item_label is defined
? selected_item_label
: _self.get_translated_label(choice.label, translation_domain)
: _self.get_translated_label(choice.label, choice_translation_domain)
%}

{% include selected_item_template_path with {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
multiple: form.vars.multiple,
custom_init: attr.dropdown_custom_init|default(false),
class: attr.dropdown_class|default(''),
translation_domain: choice_translation_domain|default(false),
choice_translation_domain: choice_translation_domain|default(false),
translation_domain: translation_domain|default(false),
custom_form: false,
is_disabled: attr.disabled|default(false) or disabled|default(false) or dropdown_disabled|default(false),
is_hidden: attr.dropdown_hidden|default(false),
Expand Down

0 comments on commit 31a2674

Please sign in to comment.