File tree 1 file changed +16
-3
lines changed 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -1071,9 +1071,22 @@ file
1071
1071
1072
1072
When executing the ``translation:extract `` command, it uses extractors to
1073
1073
extract translation messages from a file. By default, the Symfony Framework
1074
- has a :class: `Symfony\\ Bridge\\ Twig\\ Translation\\ TwigExtractor ` and a
1075
- :class: `Symfony\\ Component\\ Translation\\ Extractor\\ PhpExtractor `, which
1076
- help to find and extract translation keys from Twig templates and PHP files.
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.
1076
+
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:
1081
+
1082
+ .. code-block :: terminal
1083
+
1084
+ $ composer require nikic/php-parser
1085
+
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.
1077
1090
1078
1091
You can create your own extractor by creating a class that implements
1079
1092
:class: `Symfony\\ Component\\ Translation\\ Extractor\\ ExtractorInterface `
You can’t perform that action at this time.
0 commit comments