how to translate the dynamic content in angular 7 using ngx-translate

Viewed 212

I was having trouble to translate the dynamic content which I am loading from the referance object.

Have any one found any proper solution for that?

currencyDesc: { [key: string]: string } =  {
  '01' : 'USD',
  '02' : 'Euro',
  '03' : 'Pound',
  '00' : 'CAD'
};

//en.json

{

"currency:{
"CAD":"CAD_EN"
"EURI":"EURO_EN"
}
}
<span class="custom-span" data-e2e-id="companyCode">{{currencyDesc[data?.details?.currency]}}</span>

How I can translate currency string?

1 Answers
Related