Skip to content

Improve ISO references #3249

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

Merged
merged 2 commits into from
Dec 1, 2013
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
8 changes: 4 additions & 4 deletions book/translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ into the language of the user::

The term *locale* refers roughly to the user's language and country. It
can be any string that your application uses to manage translations and
other format differences (e.g. currency format). The `ISO639-1`_
*language* code, an underscore (``_``), then the `ISO3166 Alpha-2`_
other format differences (e.g. currency format). The `ISO 639-1`_
*language* code, an underscore (``_``), then the `ISO 3166-1 alpha-2`_
*country* code (e.g. ``fr_FR`` for French/France) is recommended.

In this chapter, you'll learn how to use the Translation component in the
Expand Down Expand Up @@ -673,6 +673,6 @@ steps:
be set on the user's session.

.. _`i18n`: http://en.wikipedia.org/wiki/Internationalization_and_localization
.. _`ISO3166 Alpha-2`: http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes
.. _`ISO639-1`: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
.. _`ISO 3166-1 alpha-2`: http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes
.. _`ISO 639-1`: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
.. _`Translatable Extension`: https://github.com/l3pp4rd/DoctrineExtensions
8 changes: 4 additions & 4 deletions components/translation/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ The constructor of the ``Translator`` class needs one argument: The locale.

The term *locale* refers roughly to the user's language and country. It
can be any string that your application uses to manage translations and
other format differences (e.g. currency format). The `ISO639-1`_
*language* code, an underscore (``_``), then the `ISO3166 Alpha-2`_
other format differences (e.g. currency format). The `ISO 639-1`_
*language* code, an underscore (``_``), then the `ISO 3166-1 alpha-2`_
*country* code (e.g. ``fr_FR`` for French/France) is recommended.

.. _component-translator-message-catalogs:
Expand Down Expand Up @@ -206,5 +206,5 @@ Usage
Read how to use the Translation component in :doc:`/components/translation/usage`.

.. _Packagist: https://packagist.org/packages/symfony/translation
.. _`ISO3166 Alpha-2`: http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes
.. _`ISO639-1`: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
.. _`ISO 3166-1 alpha-2`: http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes
.. _`ISO 639-1`: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
4 changes: 3 additions & 1 deletion reference/constraints/Country.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Country
=======

Validates that a value is a valid two-letter country code.
Validates that a value is a valid `ISO 3166-1 alpha-2`_ country code.

+----------------+------------------------------------------------------------------------+
| Applies to | :ref:`property or method <validation-property-target>` |
Expand Down Expand Up @@ -81,3 +81,5 @@ message
**type**: ``string`` **default**: ``This value is not a valid country.``

This message is shown if the string is not a valid country code.

.. _`ISO 3166-1 alpha-2`: http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes
3 changes: 2 additions & 1 deletion reference/constraints/Language.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Language
========

Validates that a value is a valid language code.
Validates that a value is a valid language *Unicode language identifier*
(e.g. ``fr`` or ``zh-Hant``).

+----------------+------------------------------------------------------------------------+
| Applies to | :ref:`property or method <validation-property-target>` |
Expand Down
7 changes: 5 additions & 2 deletions reference/constraints/Locale.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ Locale

Validates that a value is a valid locale.

The "value" for each locale is either the two letter ISO639-1 *language* code
The "value" for each locale is either the two letter `ISO 639-1`_ *language* code
(e.g. ``fr``), or the language code followed by an underscore (``_``), then
the ISO3166 *country* code (e.g. ``fr_FR`` for French/France).
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 @@ -85,3 +85,6 @@ message
**type**: ``string`` **default**: ``This value is not a valid locale.``

This message is shown if the string is not a valid locale.

.. _`ISO 639-1`: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
.. _`ISO 3166-1 alpha-2`: http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes
10 changes: 7 additions & 3 deletions reference/forms/types/locale.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ The ``locale`` type is a subset of the ``ChoiceType`` that allows the user
to select from a large list of locales (language+country). As an added bonus,
the locale names are displayed in the language of the user.

The "value" for each locale is either the two letter ISO639-1 *language* code
(e.g. ``fr``), or the language code followed by an underscore (``_``), then
the ISO3166 *country* code (e.g. ``fr_FR`` for French/France).
The "value" for each locale is either 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).

.. note::

Expand Down Expand Up @@ -85,3 +86,6 @@ These options inherit from the :doc:`form </reference/forms/types/form>` type:
.. include:: /reference/forms/types/options/disabled.rst.inc

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

.. _`ISO 639-1`: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
.. _`ISO 3166-1 alpha-2`: http://en.wikipedia.org/wiki/ISO_3166-1#Current_codes