Closed as not planned
Closed as not planned
Description
Symfony version(s) affected
7.1
Description
Documentation mentions
The translation:extract command looks for missing translations in:
...
- Any PHP file/class that injects or autowires the translator service and makes calls to the trans() method..
...
When bundle is specified, this does not work as stated. Following line limits path to extract texts to only bundle template folder:
I did not find any other official way to extract PHP code translations from bundle. I believe at least PHP files using translator
service should be included in extracted bundle translations.
How to reproduce
php bin/console translation:extract --force fr AcmeBundle
Only translations from templates (AcmeBundle/templates
) are extracted. No PHP trans()
calls are extracted.
Possible Solution
Use result from $this->getRootCodePaths($kernel)
and leave all files from given bundle.
Additional Context
No response