Is it a way to translate annotations in docscommment ?
Here is an example of my actual code:
/**
*
* The Item Name
* @var string
* @Annotation\Options({"label":"Name"})
* @Annotation\Attributes({"type":"text"})
* @ORM\Column(type="string", length=128, nullable=false, unique=true)
*/
private $name;
To translate the generated form label in my template file (I use twig):
<label for="{{field.getName()}}">
{{translate(field.getLabel())}}:
</label>
It works well, except a parser like POEdit cannot fint the term "Name" with this way. For now I use a private method into my model to inform the parser that terms exists... But it's dirty..
/**
* Unused in the software, used by external parser.
*/
private final function parseTranslations()
{
$this->translate('Name');
return null;
}
Is there a better solution to fix this and translate terms in docscomments ?