Skip to content

Commit 5db96ed

Browse files
committed
[Form] Documented the choice_self_translation option of LanguageType
1 parent d91f1c2 commit 5db96ed

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

reference/forms/types/language.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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,19 @@ If this option is ``true``, the choice values use the `ISO 639-2 alpha-3`_
7475
three-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+
If this option is ``true``, each choice value is translated into its own
88+
language instead of translating all of them into the current application locale
89+
(e.g. ``[..., 'cs' => 'čeština', 'es' => 'español', ..., 'zh' => '中文']``).
90+
7791
.. include:: /reference/forms/types/options/choice_translation_locale.rst.inc
7892

7993
Overridden Options

0 commit comments

Comments
 (0)