bcabanes / gulp-angular-translate-extract

Gulp version of grunt-angular-translate.
MIT License
14 stars 12 forks source link

Is { necessary in the HtmlDirective regex #17

Open samal-rasmussen opened 8 years ago

samal-rasmussen commented 8 years ago

The HtmlDirective regex looks like this: <[^>]*translate[^{>]*>([^<]*)<\/[^>]*>

This will not match when I use the translate-values directive before the translate directive, because of the { in the middle of the HtmlDirective regex: <span translate translate-values="{'something':$ctrl.something}">translation.key</span>

An easy workaround is to put the translate directive after the translate-values directive: <span translate-values="{'something':$ctrl.something}" translate>translation.key</span>

But I am wondering what the { in the HtmlDirective regex is even guarding against? Is it safe to remove? I see no changes when I remove it and run translate extract on the codebase I'm working on atm.