Skip to content

Commit 77089fa

Browse files
natewiebe13wouterj
authored andcommitted
Update docs relating to translation extraction
1 parent 9dd09fa commit 77089fa

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

translation.rst

+5
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

@@ -386,6 +388,9 @@ The ``translation:update`` command looks for missing translations in:
386388
:ref:`twig.paths <config-twig-paths>` config options);
387389
* Any PHP file/class that injects or :doc:`autowires </service_container/autowiring>`
388390
the ``translator`` service and makes calls to the ``trans()`` method.
391+
* Any PHP file/class stored in the ``src/`` directory that creates
392+
:ref:`translatable-objects` using the constructor or the ``t()`` method or calls
393+
the ``trans()`` method.
389394

390395
.. _translation-resource-locations:
391396

translation/debug.rst

+4-3
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)