@@ -24,6 +24,7 @@ manually, but then you should just use the ``ChoiceType`` directly.
2424| Rendered as | can be various tags (see :ref: `forms-reference-choice-tags `) |
2525+-------------+------------------------------------------------------------------------+
2626| Options | - `alpha3 `_ |
27+ | | - `choice_self_translation `_ |
2728| | - `choice_translation_locale `_ |
2829+-------------+------------------------------------------------------------------------+
2930| Overridden | - `choices `_ |
@@ -74,6 +75,23 @@ If this option is ``true``, the choice values use the `ISO 639-2 alpha-3`_
7475three-letter codes (e.g. French = ``fra ``) instead of the default
7576`ISO 639-1 alpha-2 `_ two-letter codes (e.g. French = ``fr ``).
7677
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+
7795.. include :: /reference/forms/types/options/choice_translation_locale.rst.inc
7896
7997Overridden Options
0 commit comments