2

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?

app
  • 197
  • 8
  • 24

1 Answers1

0

For the dynamic content ngx translate will not work, refer in below link

ngx-translate is just a pipe, a service and a directive allowing to translate keys into values, at runtime

Ngx translate aot compilation: changing translation in production code

Rama Krishna
  • 645
  • 10
  • 28