Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Minor changes
  • Loading branch information
javiereguiluz authored Feb 23, 2018
commit 4c28e1fc76d4e3fce7d0295a3e0b61013ce0dfc2
11 changes: 6 additions & 5 deletions reference/constraints/Locale.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ Locale

Validates that a value is a valid locale.

The "value" for each locale is any of `ICU format locale IDs`. By instance the two
letter `ISO 639-1`_ *language* code (e.g. ``fr``), or the language code followed
by an underscore (``_``), then the `ISO 3166-1 alpha-2`_ *country* code (e.g. ``fr_FR``
for French/France).
The "value" for each locale is any of `ICU format locale IDs`_. For example, the
two letter `ISO 639-1`_ *language* code (e.g. ``fr``), or the language code
followed by an underscore (``_``) and the `ISO 3166-1 alpha-2`_ *country* code
(e.g. ``fr_FR`` for French/France).

+----------------+------------------------------------------------------------------------+
| Applies to | :ref:`property or method <validation-property-target>` |
Expand Down Expand Up @@ -103,12 +103,13 @@ canonicalize

.. versionadded:: 4.1
Using this option with value ``false`` was deprecated in Symfony 4.1 and it
will throw an exception in Symfony 5.0, use `true` instead.
  will throw an exception in Symfony 5.0. Use ``true`` instead.

If true, the :phpmethod:`Locale::canonicalize` method will be applied before checking
the validity of the given locale (e.g. ``FR-fr.utf8`` is transformed into ``fr_FR``
).

.. _`ICU format locale IDs`: http://userguide.icu-project.org/locale
.. _`ISO 639-1`: https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
.. _`ISO 3166-1 alpha-2`: https://en.wikipedia.org/wiki/ISO_3166-1#Current_codes
.. _`ICU format locale IDs`: http://userguide.icu-project.org/locale#TOC-Canonicalization