Skip to content
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

[Form] add choice_translation_domain option to date types #6302

Merged
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions reference/forms/types/birthday.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ option defaults to 120 years ago to the current year.
+----------------------+-------------------------------------------------------------------------------+
| Inherited options | from the :doc:`DateType </reference/forms/types/date>`: |
| | |
| | - `choice_translation_domain`_ |
| | - `days`_ |
| | - `placeholder`_ |
| | - `format`_ |
Expand Down Expand Up @@ -64,6 +65,8 @@ Inherited Options

These options inherit from the :doc:`DateType </reference/forms/types/date>`:

.. include:: /reference/forms/types/options/datetime_choice_translation_domain.rst.inc

.. include:: /reference/forms/types/options/days.rst.inc

placeholder
Expand Down
5 changes: 4 additions & 1 deletion reference/forms/types/date.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`_ |
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion reference/forms/types/datetime.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`_ |
Expand Down Expand Up @@ -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
~~~~~~~~~~~

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
choice_translation_domain
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we reuse the already existing file from the choice type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would have. Unfortunately there is a conflict between added version : 2.7 for choice types but 2.8 for date types.
Do you know a way to override only the note in a block like this ?

Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately no. But maybe we can update the description of the existing option with what you used here (imo it's more clear than what we already have).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't understand, I've just copy-pasted the current description and changed the version added.

~~~~~~~~~~~~~~~~~~~~~~~~~

.. 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.
5 changes: 4 additions & 1 deletion reference/forms/types/time.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`_ |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you prefer to merge that one first or to reorder in 2.7 with a rebase here ?

| | - `hours`_ |
| | - `html5`_ |
| | - `input`_ |
Expand Down Expand Up @@ -82,6 +83,8 @@ values.
Field Options
-------------

.. include:: /reference/forms/types/options/datetime_choice_translation_domain.rst.inc

placeholder
~~~~~~~~~~~

Expand Down