Skip to content

Commit a3e5a06

Browse files
committed
[Translation] Update the PHP extraction information for Symfony 7.0
1 parent f09f333 commit a3e5a06

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

reference/dic_tags.rst

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,23 +1071,16 @@ file
10711071

10721072
When executing the ``translation:extract`` command, it uses extractors to
10731073
extract translation messages from a file. By default, the Symfony Framework
1074-
has a :class:`Symfony\\Bridge\\Twig\\Translation\\TwigExtractor` and a PHP
1075-
extractor to find and extract translation keys from Twig templates and PHP files.
1074+
has a :class:`Symfony\\Bridge\\Twig\\Translation\\TwigExtractor` to find and
1075+
extract translation keys from Twig templates.
10761076

1077-
Symfony includes two PHP extractors: :class:`Symfony\\Component\\Translation\\Extractor\\PhpExtractor`
1078-
and :class:`Symfony\\Component\\Translation\\Extractor\\PhpAstExtractor`. The
1079-
first one is simple but doesn't require to install any packages; the second one
1080-
is much more advanced, but requires to install this dependency in your project:
1077+
If you also want to find and extract translation keys from PHP files, install
1078+
the following dependency to activate the :class:`Symfony\\Component\\Translation\\Extractor\\PhpAstExtractor`:
10811079

10821080
.. code-block:: terminal
10831081
10841082
$ composer require nikic/php-parser
10851083
1086-
.. deprecated:: 6.2
1087-
1088-
The ``PhpExtractor`` class is deprecated since Symfony 6.2. The ``PhpAstExtractor``
1089-
class will be the only PHP extractor available starting from Symfony 7.0.
1090-
10911084
You can create your own extractor by creating a class that implements
10921085
:class:`Symfony\\Component\\Translation\\Extractor\\ExtractorInterface`
10931086
and tagging the service with ``translation.extractor``. The tag has one

0 commit comments

Comments
 (0)