@@ -24,6 +24,7 @@ manually, but then you should just use the ``ChoiceType`` directly.
24
24
| Rendered as | can be various tags (see :ref: `forms-reference-choice-tags `) |
25
25
+-------------+------------------------------------------------------------------------+
26
26
| Options | - `alpha3 `_ |
27
+ | | - `choice_self_translation `_ |
27
28
| | - `choice_translation_locale `_ |
28
29
+-------------+------------------------------------------------------------------------+
29
30
| Overridden | - `choices `_ |
@@ -74,6 +75,23 @@ If this option is ``true``, the choice values use the `ISO 639-2 alpha-3`_
74
75
three-letter codes (e.g. French = ``fra ``) instead of the default
75
76
`ISO 639-1 alpha-2 `_ two-letter codes (e.g. French = ``fr ``).
76
77
78
+ choice_self_translation
79
+ ~~~~~~~~~~~~~~~~~~~~~~~
80
+
81
+ **type **: ``boolean `` **default **: ``false ``
82
+
83
+ .. versionadded :: 5.1
84
+
85
+ The ``choice_self_translation `` option was introduced in Symfony 5.1.
86
+
87
+ By default, the choice values are translated into the locale of the application.
88
+ For example, when using ``en `` as the locale, you'll get an array like
89
+ ``[..., 'cs' => 'Czech', ..., 'es' => 'Spanish', ..., 'zh' => 'Chinese'] ``.
90
+
91
+ If this option is ``true ``, each choice value is translated into its own
92
+ language. The resulting array is the same regardless of the application locale:
93
+ ``[..., 'cs' => 'čeština', ..., 'es' => 'español', ..., 'zh' => '中文'] ``.
94
+
77
95
.. include :: /reference/forms/types/options/choice_translation_locale.rst.inc
78
96
79
97
Overridden Options
0 commit comments