[Translation] translation:extract
with bundle - should also extract translations from PHP code
#54798
Labels
translation:extract
with bundle - should also extract translations from PHP code
#54798
Symfony version(s) affected
7.1
Description
Documentation mentions
When bundle is specified, this does not work as stated. Following line limits path to extract texts to only bundle template folder:
symfony/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php
Line 159 in 29b00c2
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
Only translations from templates (
AcmeBundle/templates
) are extracted. No PHPtrans()
calls are extracted.Possible Solution
Use result from
$this->getRootCodePaths($kernel)
and leave all files from given bundle.symfony/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php
Lines 149 to 159 in 29b00c2
Additional Context
No response
The text was updated successfully, but these errors were encountered: