我在翻译从引用对象加载的动态内容时遇到了问题。
有没有人为此找到合适的解决方案?
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>
如何转换货币字符串?
发布于 2020-11-07 02:24:16
有关ngx翻译的动态内容不起作用,请参阅以下链接
ngx-translate只是一个管道、一个服务和一个指令,允许在运行时将键转换为值
Ngx translate aot compilation: changing translation in production code
https://stackoverflow.com/questions/64701444
复制相似问题