From 540cefe1e31cc8bba078ba796d3d0715525270e4 Mon Sep 17 00:00:00 2001 From: Jules Pietri Date: Wed, 24 Feb 2016 12:11:54 +0100 Subject: [PATCH] [Form] add `choice_translation_domain` option to date types --- reference/forms/types/birthday.rst | 3 +++ reference/forms/types/date.rst | 5 ++++- reference/forms/types/datetime.rst | 5 ++++- .../datetime_choice_translation_domain.rst.inc | 15 +++++++++++++++ reference/forms/types/time.rst | 5 ++++- 5 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 reference/forms/types/options/datetime_choice_translation_domain.rst.inc diff --git a/reference/forms/types/birthday.rst b/reference/forms/types/birthday.rst index eb605d661aa..a1e10ed5ec0 100644 --- a/reference/forms/types/birthday.rst +++ b/reference/forms/types/birthday.rst @@ -24,6 +24,7 @@ option defaults to 120 years ago to the current year. +----------------------+-------------------------------------------------------------------------------+ | Inherited options | from the :doc:`DateType `: | | | | +| | - `choice_translation_domain`_ | | | - `days`_ | | | - `placeholder`_ | | | - `format`_ | @@ -64,6 +65,8 @@ Inherited Options These options inherit from the :doc:`DateType `: +.. include:: /reference/forms/types/options/datetime_choice_translation_domain.rst.inc + .. include:: /reference/forms/types/options/days.rst.inc placeholder diff --git a/reference/forms/types/date.rst b/reference/forms/types/date.rst index 0e075b9b63c..06936069440 100644 --- a/reference/forms/types/date.rst +++ b/reference/forms/types/date.rst @@ -19,7 +19,8 @@ day and year) or three select boxes (see the `widget`_ option). +----------------------+-----------------------------------------------------------------------------+ | Rendered as | single text box or three select fields | +----------------------+-----------------------------------------------------------------------------+ -| Options | - `days`_ | +| Options | - `choice_translation_domain`_ | +| | - `days`_ | | | - `placeholder`_ | | | - `format`_ | | | - `html5`_ | @@ -85,6 +86,8 @@ values. Field Options ------------- +.. include:: /reference/forms/types/options/datetime_choice_translation_domain.rst.inc + .. include:: /reference/forms/types/options/days.rst.inc placeholder diff --git a/reference/forms/types/datetime.rst b/reference/forms/types/datetime.rst index e8c66a8cafc..e251c14d0b5 100644 --- a/reference/forms/types/datetime.rst +++ b/reference/forms/types/datetime.rst @@ -15,7 +15,8 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array. +----------------------+-----------------------------------------------------------------------------+ | Rendered as | single text box or three select fields | +----------------------+-----------------------------------------------------------------------------+ -| Options | - `date_format`_ | +| Options | - `choice_translation_domain`_ | +| | - `date_format`_ | | | - `date_widget`_ | | | - `days`_ | | | - `placeholder`_ | @@ -55,6 +56,8 @@ the data can be a ``DateTime`` object, a string, a timestamp or an array. Field Options ------------- +.. include:: /reference/forms/types/options/datetime_choice_translation_domain.rst.inc + date_format ~~~~~~~~~~~ diff --git a/reference/forms/types/options/datetime_choice_translation_domain.rst.inc b/reference/forms/types/options/datetime_choice_translation_domain.rst.inc new file mode 100644 index 00000000000..0e58251adda --- /dev/null +++ b/reference/forms/types/options/datetime_choice_translation_domain.rst.inc @@ -0,0 +1,15 @@ +choice_translation_domain +~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. versionadded:: 2.8 + The ``choice_translation_domain`` option was introduced in Symfony 2.8. + +**type**: ``string``, ``boolean`` or ``null`` + +This option determines if the choice values should be translated and in which +translation domain. + +The values of the ``choice_translation_domain`` option can be ``true`` (reuse the current +translation domain), ``false`` (disable translation), ``null`` (uses the parent translation +domain or the default domain) or a string which represents the exact translation +domain to use. diff --git a/reference/forms/types/time.rst b/reference/forms/types/time.rst index d2770b49ca9..29a8add61d2 100644 --- a/reference/forms/types/time.rst +++ b/reference/forms/types/time.rst @@ -15,7 +15,8 @@ stored as a ``DateTime`` object, a string, a timestamp or an array. +----------------------+-----------------------------------------------------------------------------+ | Rendered as | can be various tags (see below) | +----------------------+-----------------------------------------------------------------------------+ -| Options | - `placeholder`_ | +| Options | - `choice_translation_domain`_ | +| | - `placeholder`_ | | | - `hours`_ | | | - `html5`_ | | | - `input`_ | @@ -82,6 +83,8 @@ values. Field Options ------------- +.. include:: /reference/forms/types/options/datetime_choice_translation_domain.rst.inc + placeholder ~~~~~~~~~~~