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

Update translation.rst #20571

Open
wants to merge 1 commit into
base: 7.1
Choose a base branch
from
Open
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
18 changes: 9 additions & 9 deletions translation.rst
nassimlnd marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ different formats:
.. code-block:: yaml

# translations/messages.fr.yaml
Symfony is great: J'aime Symfony
Symfony is great: Symfony est génial

.. code-block:: xml

Expand All @@ -156,7 +156,7 @@ different formats:
<body>
<trans-unit id="symfony_is_great">
<source>Symfony is great</source>
<target>J'aime Symfony</target>
<target>Symfony est génial</target>
</trans-unit>
</body>
</file>
Expand All @@ -166,14 +166,14 @@ different formats:

// translations/messages.fr.php
return [
'Symfony is great' => "J'aime Symfony",
'Symfony is great' => 'Symfony est génial',
];

You can find more information on where these files
:ref:`should be located <translation-resource-locations>`.

Now, if the language of the user's locale is French (e.g. ``fr_FR`` or ``fr_BE``),
the message will be translated into ``J'aime Symfony``. You can also translate
the message will be translated into ``Symfony est génial``. You can also translate
the message inside your :ref:`templates <translation-in-templates>`.

.. _translation-real-vs-keyword-messages:
Expand Down Expand Up @@ -1192,7 +1192,7 @@ for the ``fr`` locale:
<body>
<trans-unit id="1">
<source>Symfony is great</source>
<target>J'aime Symfony</target>
<target>Symfony est génial</target>
</trans-unit>
</body>
</file>
Expand All @@ -1201,13 +1201,13 @@ for the ``fr`` locale:
.. code-block:: yaml

# translations/messages.fr.yaml
Symfony is great: J'aime Symfony
Symfony is great: Symfony est génial

.. code-block:: php

// translations/messages.fr.php
return [
'Symfony is great' => 'J\'aime Symfony',
'Symfony is great' => 'Symfony est génial',
];

and for the ``en`` locale:
Expand Down Expand Up @@ -1250,7 +1250,7 @@ To inspect all messages in the ``fr`` locale for the application, run:
--------- ------------------ ---------------------- -------------------------------
State Id Message Preview (fr) Fallback Message Preview (en)
--------- ------------------ ---------------------- -------------------------------
unused Symfony is great J'aime Symfony Symfony is great
unused Symfony is great Symfony est génial Symfony is great
--------- ------------------ ---------------------- -------------------------------

It shows you a table with the result when translating the message in the ``fr``
Expand All @@ -1270,7 +1270,7 @@ output:
--------- ------------------ ---------------------- -------------------------------
State Id Message Preview (fr) Fallback Message Preview (en)
--------- ------------------ ---------------------- -------------------------------
Symfony is great J'aime Symfony Symfony is great
Symfony is great Symfony est génial Symfony is great
--------- ------------------ ---------------------- -------------------------------

The state is empty which means the message is translated in the ``fr`` locale
Expand Down
Loading