Skip to content

Commit 43f4125

Browse files
committed
Added documentation for choice_translation_domain option
1 parent 703abe3 commit 43f4125

File tree

3 files changed

+46
-23
lines changed

3 files changed

+46
-23
lines changed

reference/forms/types/choice.rst

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ would replace the ``choices`` option.
231231

232232
.. include:: /reference/forms/types/options/placeholder.rst.inc
233233

234+
.. include:: /reference/forms/types/options/choice_translation_domain.rst.inc
235+
234236
.. include:: /reference/forms/types/options/expanded.rst.inc
235237

236238
.. include:: /reference/forms/types/options/multiple.rst.inc
@@ -346,29 +348,32 @@ type:
346348
Field Variables
347349
---------------
348350

349-
+------------------------+--------------+-------------------------------------------------------------------+
350-
| Variable | Type | Usage |
351-
+========================+==============+===================================================================+
352-
| multiple | ``boolean`` | The value of the `multiple`_ option. |
353-
+------------------------+--------------+-------------------------------------------------------------------+
354-
| expanded | ``boolean`` | The value of the `expanded`_ option. |
355-
+------------------------+--------------+-------------------------------------------------------------------+
356-
| preferred_choices | ``array`` | A nested array containing the ``ChoiceView`` objects of |
357-
| | | choices which should be presented to the user with priority. |
358-
+------------------------+--------------+-------------------------------------------------------------------+
359-
| choices | ``array`` | A nested array containing the ``ChoiceView`` objects of |
360-
| | | the remaining choices. |
361-
+------------------------+--------------+-------------------------------------------------------------------+
362-
| separator | ``string`` | The separator to use between choice groups. |
363-
+------------------------+--------------+-------------------------------------------------------------------+
364-
| placeholder | ``mixed`` | The empty value if not already in the list, otherwise |
365-
| | | ``null``. |
366-
+------------------------+--------------+-------------------------------------------------------------------+
367-
| is_selected | ``callable`` | A callable which takes a ``ChoiceView`` and the selected value(s) |
368-
| | | and returns whether the choice is in the selected value(s). |
369-
+------------------------+--------------+-------------------------------------------------------------------+
370-
| placeholder_in_choices | ``boolean`` | Whether the empty value is in the choice list. |
371-
+------------------------+--------------+-------------------------------------------------------------------+
351+
+----------------------------+--------------+-------------------------------------------------------------------+
352+
| Variable | Type | Usage |
353+
+============================+==============+===================================================================+
354+
| multiple | ``boolean`` | The value of the `multiple`_ option. |
355+
+----------------------------+--------------+-------------------------------------------------------------------+
356+
| expanded | ``boolean`` | The value of the `expanded`_ option. |
357+
+----------------------------+--------------+-------------------------------------------------------------------+
358+
| preferred_choices | ``array`` | A nested array containing the ``ChoiceView`` objects of |
359+
| | | choices which should be presented to the user with priority. |
360+
+----------------------------+--------------+-------------------------------------------------------------------+
361+
| choices | ``array`` | A nested array containing the ``ChoiceView`` objects of |
362+
| | | the remaining choices. |
363+
+----------------------------+--------------+-------------------------------------------------------------------+
364+
| separator | ``string`` | The separator to use between choice groups. |
365+
+----------------------------+--------------+-------------------------------------------------------------------+
366+
| placeholder | ``mixed`` | The empty value if not already in the list, otherwise |
367+
| | | ``null``. |
368+
+----------------------------+--------------+-------------------------------------------------------------------+
369+
| choice_translation_domain | ``mixed`` | ``boolean``, ``null`` or ``string`` to determine if the value |
370+
| | | should be translated. |
371+
+----------------------------+--------------+-------------------------------------------------------------------+
372+
| is_selected | ``callable`` | A callable which takes a ``ChoiceView`` and the selected value(s) |
373+
| | | and returns whether the choice is in the selected value(s). |
374+
+----------------------------+--------------+-------------------------------------------------------------------+
375+
| placeholder_in_choices | ``boolean`` | Whether the empty value is in the choice list. |
376+
+----------------------------+--------------+-------------------------------------------------------------------+
372377

373378
.. tip::
374379

reference/forms/types/entity.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ objects from the database.
2323
| Inherited | from the :doc:`choice </reference/forms/types/choice>` type: |
2424
| options | |
2525
| | - `placeholder`_ |
26+
| | - `choice_translation_domain`_ |
2627
| | - `expanded`_ |
2728
| | - `multiple`_ |
2829
| | - `preferred_choices`_ |
@@ -195,6 +196,8 @@ type:
195196

196197
.. include:: /reference/forms/types/options/placeholder.rst.inc
197198

199+
.. include:: /reference/forms/types/options/choice_translation_domain.rst.inc
200+
198201
.. include:: /reference/forms/types/options/expanded.rst.inc
199202

200203
.. include:: /reference/forms/types/options/multiple.rst.inc
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
choice_translation_domain
2+
~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+
.. versionadded:: 2.7
5+
The ``choice_translation_domain`` option was introduced in Symfony 2.7.
6+
7+
**type**: ``string``, ``boolean`` or ``null``
8+
9+
This option determines if the choice values should be translated and in which
10+
translation domain.
11+
12+
The values of the ``choice_translation_domain`` option can be ``true`` (reuse the current
13+
translation domain), ``false`` (disable translation), ``null`` (uses the parent translation
14+
domain or the default domain) or a string which represents the exact translation
15+
domain to use.

0 commit comments

Comments
 (0)