kalessil / yii2inspections

MIT License
31 stars 3 forks source link

Loosen up the regex for `|t()` for Twig template translations #28

Closed khalwat closed 5 years ago

khalwat commented 6 years ago

It'd be great if the "Add missing Translations" inspection worked with any combination of the following for Twig templates:

"somestring"|t("somecat") "somestring" |t("somecat") "somestring" | t("somecat")

In other words, being agnostic about whitespace before/after the | -- I found that I wrote my translations like this in Twig:

"somestring" |t("somecat")

...and it didn't pick any of them up. Took me some time to figure out what was going on!

Thanks for reading, and also for the plugin!

kalessil commented 6 years ago

Thank you @khalwat, will be fixed in the next release.

brandonkelly commented 6 years ago

Probably also worth checking for translate in addition to t as they are aliases.

kalessil commented 5 years ago

Fixed!