Parcourir la source

merged branch Tuxosaurus/master (PR #1475)

Commits
-------

4e7b16f Added "trans" Twig filters to labels in the "widget_choice_options" block

Discussion
----------

Missing "trans" Twig filters for labels in the "widget_choice_options" block

Added "trans" Twig filters to labels in the "widget_choice_options" block.
A quick fix for a quick need, there might be other missing trans filters remaining.
Fabien Potencier il y a 14 ans
Parent
commit
ed4de1f2cc

+ 2 - 2
src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig

@@ -21,11 +21,11 @@
         {% if _form_is_choice_group(label) %}
             <optgroup label="{{ choice }}">
                 {% for nestedChoice, nestedLabel in label %}
-                    <option value="{{ nestedChoice }}"{% if _form_is_choice_selected(form, nestedChoice) %} selected="selected"{% endif %}>{{ nestedLabel }}</option>
+                    <option value="{{ nestedChoice }}"{% if _form_is_choice_selected(form, nestedChoice) %} selected="selected"{% endif %}>{{ nestedLabel|trans }}</option>
                 {% endfor %}
             </optgroup>
         {% else %}
-            <option value="{{ choice }}"{% if _form_is_choice_selected(form, choice) %} selected="selected"{% endif %}>{{ label }}</option>
+            <option value="{{ choice }}"{% if _form_is_choice_selected(form, choice) %} selected="selected"{% endif %}>{{ label|trans }}</option>
         {% endif %}
     {% endfor %}
 {% endspaceless %}