grunt-angular-translate
grunt-angular-translate copied to clipboard
Missing some translations
I can’t get it to find several translations in my template (although it finds some others). For example:
<p ng-show="applied_coupon.duration == 'forever'" translate translate-values="{ total: applied_coupon.total }">Your card will be charged { total } + VAT every month.</p>
<p ng-show="applied_coupon.duration == 'once'" translate translate-values="{ coupon_total: applied_coupon.total, subscription_amount: subscription_plan.amount }">Your card will be charged { coupon_total } + VAT for the first month and then { subscription_amount } + VAT every month.</p>
<p ng-show="applied_coupon.duration == 'repeating'" translate translate-values="{ coupon_total: applied_coupon.total, coupon_duration_in_months: applied_coupon.duration_in_months, subscription_amount: subscription_plan.amount }">Your card will be charged { coupon_total } + VAT every month for the first { coupon_duration_in_months } months, and then { subscription_amount } + VAT every month.</p>
<p ng-hide="applied_coupon" translate translate-values="{ amount: subscription_plan.amount }">Your card will be charged { amount } + VAT every month.</p>
None of the above are found. However, I can match them just fine if I paste the HtmlDirective
regex on regex101.com. So the regex works.
Any idea why it would skip them?
I managed to solve it by switching the order of attributes: if translate
goes after translate-values
, it works.
However, it should work in the original order, too. The regex allows any characters (except >
) between translate
attribute and the closing >
. I can’t figure out why it doesn’t work.