Closed pdias closed 2 years ago
have you included
use Translation\Extractor\Annotation\Translate;
?
Yes.
Hello,
I got the same problem. I installed the bundle. Add annotation over the key trad I want to be extracted:
new Metas( 'mission_oid', /* @Translate({"domain"="document"}) */ 'document_metas_oid' );
I found that there is two errors:
First the "Translation\Extractor\Visitor\Php\TranslateAnnotationVisitor" that manage the annotation extracting is not a service and not tagged with the "php_translation.visitor".
So I fix it with :
` services: Translation\Extractor\Visitor\Php\TranslateAnnotationVisitor: tags:
{ name: php_translation.visitor type: php } `
Second, the annotation visitor work only on "PhpParser\Comment\Doc" so you need to have your doc as "/*" and not "/" like me.
I try to translate some labels… using annotation.
But
'delete_label' => /** @Translate */'user.photo.remove'
and'download_label' => /** @Translate */'user.photo.download'
are not extracted. Maybe I'm doing something wrong, but I don't understand what.