Skip to content

Commit 4e3684a

Browse files
committed
fix dropdown option translations
1 parent 91018ba commit 4e3684a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

modules/backend/widgets/form/partials/_field_dropdown.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
$fieldOptions = $field->options();
2+
$fieldOptions = $field->options();
33
?>
44

55
<!-- Dropdown -->
@@ -25,6 +25,11 @@
2525
if ($field->placeholder) {
2626
$options['data-placeholder'] = e(trans($field->placeholder));
2727
}
28+
foreach ($fieldOptions as $key => &$value) {
29+
if (is_string($value) && str_contains($value, '::')) {
30+
$value = e(trans($value));
31+
}
32+
}
2833
?>
2934
<?= Form::select(
3035
name: $field->getName(),

0 commit comments

Comments
 (0)