8

I am using title attribute with some condition and my code is

<li title="{{admin ? 'purchase license pack':''}}"><span translate>pack.details</span></li>

Here when the admin is true then it shows purchase license pack. But how to make that one to i18n keys by using translate filter. I tried this,

<li title="{{admin ? '{{'purchase.pack'|translate}}':''}}"><span translate>pack.details</span></li>

But It shows parsing error. How to do this?

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
VijayVishnu
  • 537
  • 2
  • 11
  • 34

1 Answers1

13

The error was natural since you were trying to interpolate the interpolation. However, You were quite close.. Try This :

<li title="{{admin ? ('purchase.pack'|translate) : ''}}"><span translate>pack.details</span></li>
Manish Kr. Shukla
  • 4,447
  • 1
  • 20
  • 35