grunt-angular-translate icon indicating copy to clipboard operation
grunt-angular-translate copied to clipboard

Missing some translations

Open PawelDecowski opened this issue 7 years ago • 1 comments

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?

PawelDecowski avatar Aug 29 '17 12:08 PawelDecowski

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.

PawelDecowski avatar Aug 29 '17 16:08 PawelDecowski