Skip to content

[2.7][Form][Entity] Added "translation_domain" and "choice_translation_domain" #5614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions reference/forms/types/entity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ objects from the database.
| Rendered as | can be various tags (see :ref:`forms-reference-choice-tags`) |
+-------------+------------------------------------------------------------------+
| Options | - `choice_label`_ |
| | - `choice_translation_domain`_ |
| | - `translation_domain`_ |
| | - `class`_ |
| | - `data_class`_ |
| | - `em`_ |
Expand Down Expand Up @@ -130,6 +132,26 @@ cast into a string and so must have a ``__toString()`` method.
'choice_label' => 'translations[en].name',
));

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is true


**type**: ``string``

When ``choice_translation_domain`` is ``true`` or ``null``, use translations of informed domain(e.g. ``AcmeStoreBundle`` to ``Acme\StoreBundle\Resources\translation`` files).

class
~~~~~

Expand Down