Skip to content

Commit 04b9a92

Browse files
committed
Merge branch '5.4' into 6.4
* 5.4: [Translation] Add labels for links in translations page [Serializer] Correction of examples using the attributes groups
2 parents eb643e6 + 8ab6435 commit 04b9a92

File tree

2 files changed

+19
-18
lines changed

2 files changed

+19
-18
lines changed

components/serializer.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ You are now able to serialize only attributes in the groups you want::
398398

399399
$obj2 = $serializer->denormalize(
400400
['foo' => 'foo', 'anotherProperty' => 'anotherProperty', 'bar' => 'bar'],
401-
'MyObj',
401+
MyObj::class,
402402
null,
403403
['groups' => ['group1', 'group3']]
404404
);
@@ -407,7 +407,7 @@ You are now able to serialize only attributes in the groups you want::
407407
// To get all groups, use the special value `*` in `groups`
408408
$obj3 = $serializer->denormalize(
409409
['foo' => 'foo', 'anotherProperty' => 'anotherProperty', 'bar' => 'bar'],
410-
'MyObj',
410+
MyObj::class,
411411
null,
412412
['groups' => ['*']]
413413
);

translation.rst

Lines changed: 17 additions & 16 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;
@@ -169,8 +169,8 @@ different formats:
169169
'Symfony is great' => "J'aime Symfony",
170170
];
171171
172-
For information on where these files should be located, see
173-
:ref:`translation-resource-locations`.
172+
You can find more information on where these files
173+
:ref:`should be located <translation-resource-locations>`.
174174

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

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

262262
#. A catalog of translated messages is loaded from translation resources
263263
defined for the ``locale`` (e.g. ``fr_FR``). Messages from the
@@ -450,10 +450,10 @@ The ``translation:extract`` command looks for missing translations in:
450450
defined in the :ref:`twig.default_path <config-twig-default-path>` and
451451
:ref:`twig.paths <config-twig-paths>` config options);
452452
* Any PHP file/class that injects or :doc:`autowires </service_container/autowiring>`
453-
the ``translator`` service and makes calls to the ``trans()`` method.
453+
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
* Any PHP file/class stored in the ``src/`` directory that uses
458458
:ref:`Constraints Attributes <validation-constraints>` with ``*message`` named argument(s).
459459

@@ -1168,10 +1168,10 @@ unused translation messages templates:
11681168
.. caution::
11691169

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

11761176
.. code-block:: twig
11771177
@@ -1180,9 +1180,10 @@ unused translation messages templates:
11801180
{{ message|trans }}
11811181
11821182
Suppose your application's default_locale is ``fr`` and you have configured
1183-
``en`` as the fallback locale (see :ref:`translation-configuration` and
1184-
:ref:`translation-fallback` for how to configure these). And suppose
1185-
you've already setup some translations for the ``fr`` locale:
1183+
``en`` as the fallback locale (see :ref:`configuration
1184+
<translation-configuration>` and :ref:`fallback <translation-fallback>` for
1185+
how to configure these). And suppose you've already set up some translations
1186+
for the ``fr`` locale:
11861187

11871188
.. configuration-block::
11881189

0 commit comments

Comments
 (0)