From 59579275442df3b40858e1170315f2e1fed7aba5 Mon Sep 17 00:00:00 2001 From: Rafael Mello Date: Mon, 10 Aug 2015 09:47:35 -0300 Subject: [PATCH 1/5] Update entity.rst Added "choice_translation_domain" and "translation_domain" documentation. --- reference/forms/types/entity.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/reference/forms/types/entity.rst b/reference/forms/types/entity.rst index 85cff817bc9..3546ddf104c 100644 --- a/reference/forms/types/entity.rst +++ b/reference/forms/types/entity.rst @@ -16,6 +16,8 @@ objects from the database. | | - `choice_label`_ | | | - `query_builder`_ | | | - `em`_ | +| | - `choice_translation_domain`_ | +| | - `translation_domain`_ | +-------------+------------------------------------------------------------------+ | Overridden | - `choices`_ | | options | | @@ -176,6 +178,26 @@ em If specified, this entity manager will be used to load the choices instead of the ``default`` entity manager. +choice_translation_domain +~~~~~~~~~~~~~ + +.. versionadded:: 2.7 + The ``choice_translation_domain`` option was introduced in Symfony 2.7. + +**type**: ``boolean`` + +This option determines whether the translation of the data obtained will be informed domain ``translation_domain``. + +translation_domain +~~~~~~~~~~~~~ + +.. versionadded:: 2.7 + The ``translation_domain`` option was introduced in Symfony 2.7. + +**type**: ``string`` + +If specified, use translations of informed domain(e.g. ``AcmeStoreBundle`` to ``Acme\StoreBundle\Resources\translation`` files). + Overridden Options ------------------ From 3ad51119c85839ed6964fef62be9ae06e78f1705 Mon Sep 17 00:00:00 2001 From: Rafael Mello Date: Mon, 10 Aug 2015 10:04:44 -0300 Subject: [PATCH 2/5] Travis fix Fixed title underline. --- reference/forms/types/entity.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/forms/types/entity.rst b/reference/forms/types/entity.rst index 3546ddf104c..4a2296f60ec 100644 --- a/reference/forms/types/entity.rst +++ b/reference/forms/types/entity.rst @@ -179,7 +179,7 @@ If specified, this entity manager will be used to load the choices instead of the ``default`` entity manager. choice_translation_domain -~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 2.7 The ``choice_translation_domain`` option was introduced in Symfony 2.7. @@ -189,7 +189,7 @@ choice_translation_domain This option determines whether the translation of the data obtained will be informed domain ``translation_domain``. translation_domain -~~~~~~~~~~~~~ +~~~~~~~~~~~~~~~~~~ .. versionadded:: 2.7 The ``translation_domain`` option was introduced in Symfony 2.7. From 2fa2386a103b0624dbda478f4ac1e7f96e9114f1 Mon Sep 17 00:00:00 2001 From: Rafael Mello Date: Sun, 30 Aug 2015 23:49:38 -0300 Subject: [PATCH 3/5] choice_translation_domain doc fix "choice_translation_domain" description fixed. --- reference/forms/types/entity.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/forms/types/entity.rst b/reference/forms/types/entity.rst index 4a2296f60ec..e2180e7ec08 100644 --- a/reference/forms/types/entity.rst +++ b/reference/forms/types/entity.rst @@ -184,9 +184,9 @@ choice_translation_domain .. versionadded:: 2.7 The ``choice_translation_domain`` option was introduced in Symfony 2.7. -**type**: ``boolean`` +**type**: ``boolean`` | ``null`` | ``string`` -This option determines whether the translation of the data obtained will be informed domain ``translation_domain``. +If specified ``null`` value, corresponds to parents translation_domain or default domain (messages). If the value is ``string``, corresponds to explicit domain(e.g. ``AcmeStoreBundle``). If the value is ``true``, reuse current ``translation_domain`` and ``false`` to disabled. translation_domain ~~~~~~~~~~~~~~~~~~ From 92998d8cb7213e4eccc2b8e2a9a2da73ca4d4d2e Mon Sep 17 00:00:00 2001 From: Rafael Mello Date: Mon, 31 Aug 2015 00:00:27 -0300 Subject: [PATCH 4/5] translation_domain doc fix "translation_domain" documentation fixed. --- reference/forms/types/entity.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/forms/types/entity.rst b/reference/forms/types/entity.rst index e2180e7ec08..6ae4953e344 100644 --- a/reference/forms/types/entity.rst +++ b/reference/forms/types/entity.rst @@ -186,7 +186,7 @@ choice_translation_domain **type**: ``boolean`` | ``null`` | ``string`` -If specified ``null`` value, corresponds to parents translation_domain or default domain (messages). If the value is ``string``, corresponds to explicit domain(e.g. ``AcmeStoreBundle``). If the value is ``true``, reuse current ``translation_domain`` and ``false`` to disabled. +If specified ``null`` value, corresponds to parents ``translation_domain`` or default domain (messages). If the value is ``string``, corresponds to explicit domain(e.g. ``AcmeStoreBundle``). If the value is ``true``, reuse current ``translation_domain`` and ``false`` to disabled. translation_domain ~~~~~~~~~~~~~~~~~~ @@ -196,7 +196,7 @@ translation_domain **type**: ``string`` -If specified, use translations of informed domain(e.g. ``AcmeStoreBundle`` to ``Acme\StoreBundle\Resources\translation`` files). +When ``choice_translation_domain`` is ``true`` or ``null``, use translations of informed domain(e.g. ``AcmeStoreBundle`` to ``Acme\StoreBundle\Resources\translation`` files). Overridden Options From 4b92e8874057475f0a1cb7632f633928ff4a8e62 Mon Sep 17 00:00:00 2001 From: WouterJ Date: Sat, 6 Feb 2016 16:57:08 +0100 Subject: [PATCH 5/5] Document translation_domain setting for choice fields --- reference/forms/types/choice.rst | 4 +++ reference/forms/types/entity.rst | 26 +++---------------- .../choice_type_translation_domain.rst.inc | 8 ++++++ 3 files changed, 15 insertions(+), 23 deletions(-) create mode 100644 reference/forms/types/options/choice_type_translation_domain.rst.inc diff --git a/reference/forms/types/choice.rst b/reference/forms/types/choice.rst index 012353f1b06..6a2e7e619c5 100644 --- a/reference/forms/types/choice.rst +++ b/reference/forms/types/choice.rst @@ -17,6 +17,7 @@ To use this field, you must specify *either* ``choices`` or ``choice_loader`` op | | - `choice_loader`_ | | | - `choice_label`_ | | | - `choice_attr`_ | +| | - `choice_translation_domain`_ | | | - `placeholder`_ | | | - `expanded`_ | | | - `multiple`_ | @@ -41,6 +42,7 @@ To use this field, you must specify *either* ``choices`` or ``choice_loader`` op | | - `mapped`_ | | | - `read_only`_ | | | - `required`_ | +| | - `translation_domain`_ | +-------------+------------------------------------------------------------------------------+ | Parent type | :doc:`form ` | +-------------+------------------------------------------------------------------------------+ @@ -348,6 +350,8 @@ type: .. include:: /reference/forms/types/options/required.rst.inc +.. include:: /reference/forms/types/options/choice_type_translation_domain.rst.inc + Field Variables --------------- diff --git a/reference/forms/types/entity.rst b/reference/forms/types/entity.rst index 6ae4953e344..434db25388f 100644 --- a/reference/forms/types/entity.rst +++ b/reference/forms/types/entity.rst @@ -16,8 +16,6 @@ objects from the database. | | - `choice_label`_ | | | - `query_builder`_ | | | - `em`_ | -| | - `choice_translation_domain`_ | -| | - `translation_domain`_ | +-------------+------------------------------------------------------------------+ | Overridden | - `choices`_ | | options | | @@ -26,6 +24,7 @@ objects from the database. | options | | | | - `placeholder`_ | | | - `choice_translation_domain`_ | +| | - `translation_domain`_ | | | - `expanded`_ | | | - `multiple`_ | | | - `preferred_choices`_ | @@ -178,27 +177,6 @@ em If specified, this entity manager will be used to load the choices instead of the ``default`` entity manager. -choice_translation_domain -~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. versionadded:: 2.7 - The ``choice_translation_domain`` option was introduced in Symfony 2.7. - -**type**: ``boolean`` | ``null`` | ``string`` - -If specified ``null`` value, corresponds to parents ``translation_domain`` or default domain (messages). If the value is ``string``, corresponds to explicit domain(e.g. ``AcmeStoreBundle``). If the value is ``true``, reuse current ``translation_domain`` and ``false`` to disabled. - -translation_domain -~~~~~~~~~~~~~~~~~~ - -.. versionadded:: 2.7 - The ``translation_domain`` option was introduced in Symfony 2.7. - -**type**: ``string`` - -When ``choice_translation_domain`` is ``true`` or ``null``, use translations of informed domain(e.g. ``AcmeStoreBundle`` to ``Acme\StoreBundle\Resources\translation`` files). - - Overridden Options ------------------ @@ -221,6 +199,8 @@ type: .. include:: /reference/forms/types/options/choice_translation_domain.rst.inc +.. include:: /reference/forms/types/options/choice_type_translation_domain.rst.inc + .. include:: /reference/forms/types/options/expanded.rst.inc .. include:: /reference/forms/types/options/multiple.rst.inc diff --git a/reference/forms/types/options/choice_type_translation_domain.rst.inc b/reference/forms/types/options/choice_type_translation_domain.rst.inc new file mode 100644 index 00000000000..87cd76cff9a --- /dev/null +++ b/reference/forms/types/options/choice_type_translation_domain.rst.inc @@ -0,0 +1,8 @@ +translation_domain +~~~~~~~~~~~~~~~~~~ + +**type**: ``string`` **default**: ``messages`` + +In case `choice_translation_domain`_ is set to ``true`` or ``null``, this +configures the exact translation domain that will be used for any labels or +options that are rendered for this field