Skip to content

Commit d7e7152

Browse files
committed
feature #15063 Update docs relating to translation extraction (natewiebe13)
This PR was squashed before being merged into the 5.3-dev branch. Discussion ---------- Update docs relating to translation extraction Update translation extraction docs based on changes from symfony/symfony#40229 Fixes #15061 Commits ------- 77089fa Update docs relating to translation extraction
2 parents 79c31b9 + 77089fa commit d7e7152

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

translation.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,8 @@ To manage these situations, Symfony follows the `ICU MessageFormat`_ syntax by
292292
using PHP's :phpclass:`MessageFormatter` class. Read more about this in
293293
:doc:`/translation/message_format`.
294294

295+
.. _translatable-objects:
296+
295297
Translatable Objects
296298
--------------------
297299

@@ -462,6 +464,9 @@ The ``translation:update`` command looks for missing translations in:
462464
:ref:`twig.paths <config-twig-paths>` config options);
463465
* Any PHP file/class that injects or :doc:`autowires </service_container/autowiring>`
464466
the ``translator`` service and makes calls to the ``trans()`` method.
467+
* Any PHP file/class stored in the ``src/`` directory that creates
468+
:ref:`translatable-objects` using the constructor or the ``t()`` method or calls
469+
the ``trans()`` method.
465470

466471
.. _translation-resource-locations:
467472

translation/debug.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ command helps you to find these missing or unused translation messages templates
1919
2020
.. caution::
2121

22-
The extractors can't find messages translated outside templates, like form
23-
labels or controllers. Dynamic translations using variables or expressions
24-
in templates are not detected either:
22+
The extractors can't find messages translated outside templates (like form
23+
labels or controllers) unless using :ref:`translatable-objects` or calling
24+
the ``trans()`` method on a translator. Dynamic translations using variables
25+
or expressions in templates are not detected either:
2526

2627
.. code-block:: twig
2728

0 commit comments

Comments
 (0)