@Desc extraction breaks on certain line endings
| Q | A |
|---|---|
| Bundle version | 1.3.1 |
| Symfony version | 3.1.7 |
| PHP version | 7.0 |
Extracting translations & using @Desc does not seem to always work - I found out that the following does not make use of the @Desc ('email.payment_amount' is saved as <source> instead of "Amount"):
/**
* @Desc("Amount")
*/
'label' => $this->translator->trans('email.payment_amount', [], 'domain') . ':',
While the following does work:
/**
* @Desc("Amount")
*/
'label' => $this->translator->trans('email.payment_amount', [], 'domain'),
The . ':' at the end of the line seems to cause some problem in extracting the @Desc value. Maybe other characters or additions to a line cause the same, which makes the translation extraction easy to break.
By the way, the following does work:
'label' =>
/**
* @Desc("Amount")
*/
$this->translator->trans('email.payment_amount', [], 'domain') . ':',
So @Desc just seems to break in some situations, but not in others (it is not obvious to me why/when it works). The problem is: you never know if it works or not until you extract the translations, so the uncertainty is quite a pain.
I also saw that there is a pull request to improve the Desc annotation: https://github.com/schmittjoh/JMSTranslationBundle/pull/233 - maybe this would also solve this issue?