Skip to content

Commit 8ab6435

Browse files
committed
minor #20142 [Translation] Add labels for links in translations page (MrYamous)
This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [Translation] Add labels for links in translations page Hello As done few times in the past adding some labels for internal links in documentation to improve readability and avoid text like this which can be confusing <img width="780" alt="Capture d’écran 2024-08-22 à 07 46 31" src="https://github.com/user-attachments/assets/c5c320ff-7e4a-487f-ae0a-fad6632420db"> [Screen from this section](https://symfony.com/doc/5.x/translation.html#how-to-find-missing-or-unused-translation-messages) Commits ------- 5203772 [Translation] Add labels for links in translations page
2 parents ce1981e + 5203772 commit 8ab6435

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

translation.rst

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ The translation process has several steps:
3333
#. :ref:`Enable and configure <translation-configuration>` Symfony's
3434
translation service;
3535

36-
#. Abstract strings (i.e. "messages") by wrapping them in calls to the
37-
``Translator`` (":ref:`translation-basic`");
36+
#. Abstract strings (i.e. "messages") by :ref:`wrapping them in calls
37+
<translation-basic>` to the ``Translator``;
3838

3939
#. :ref:`Create translation resources/files <translation-resources>`
4040
for each supported locale that translate each message in the application;
@@ -164,8 +164,8 @@ different formats:
164164
'Symfony is great' => "J'aime Symfony",
165165
];
166166
167-
For information on where these files should be located, see
168-
:ref:`translation-resource-locations`.
167+
You can find more information on where these files
168+
:ref:`should be located <translation-resource-locations>`.
169169

170170
Now, if the language of the user's locale is French (e.g. ``fr_FR`` or ``fr_BE``),
171171
the message will be translated into ``J'aime Symfony``. You can also translate
@@ -251,8 +251,8 @@ To actually translate the message, Symfony uses the following process when
251251
using the ``trans()`` method:
252252

253253
#. The ``locale`` of the current user, which is stored on the request is
254-
determined; this is typically set via a ``_locale`` attribute on your routes
255-
(see :ref:`translation-locale-url`);
254+
determined; this is typically set via a ``_locale`` :ref:`attribute on
255+
your routes <translation-locale-url>`;
256256

257257
#. A catalog of translated messages is loaded from translation resources
258258
defined for the ``locale`` (e.g. ``fr_FR``). Messages from the
@@ -452,8 +452,8 @@ The ``translation:extract`` command looks for missing translations in:
452452
* Any PHP file/class that injects or :doc:`autowires </service_container/autowiring>`
453453
the ``translator`` service and makes calls to the ``trans()`` method.
454454
* Any PHP file/class stored in the ``src/`` directory that creates
455-
:ref:`translatable-objects` using the constructor or the ``t()`` method or calls
456-
the ``trans()`` method.
455+
:ref:`translatable objects <translatable-objects>` using the constructor or
456+
the ``t()`` method or calls the ``trans()`` method.
457457

458458
.. versionadded:: 5.3
459459

@@ -1054,10 +1054,10 @@ unused translation messages templates:
10541054
.. caution::
10551055

10561056
The extractors can't find messages translated outside templates (like form
1057-
labels or controllers) unless using :ref:`translatable-objects` or calling
1058-
the ``trans()`` method on a translator (since Symfony 5.3). Dynamic
1059-
translations using variables or expressions in templates are not
1060-
detected either:
1057+
labels or controllers) unless using :ref:`translatable objects
1058+
<translatable-objects>` or calling the ``trans()`` method on a translator
1059+
(since Symfony 5.3). Dynamic translations using variables or expressions in
1060+
templates are not detected either:
10611061

10621062
.. code-block:: twig
10631063
@@ -1066,9 +1066,10 @@ unused translation messages templates:
10661066
{{ message|trans }}
10671067
10681068
Suppose your application's default_locale is ``fr`` and you have configured
1069-
``en`` as the fallback locale (see :ref:`translation-configuration` and
1070-
:ref:`translation-fallback` for how to configure these). And suppose
1071-
you've already setup some translations for the ``fr`` locale:
1069+
``en`` as the fallback locale (see :ref:`configuration
1070+
<translation-configuration>` and :ref:`fallback <translation-fallback>` for
1071+
how to configure these). And suppose you've already set up some translations
1072+
for the ``fr`` locale:
10721073

10731074
.. configuration-block::
10741075

0 commit comments

Comments
 (0)