我正在使用@ngx-translate setTranslation 方法根据代码中的某些条件在运行时更新几个值。
带有翻译的 JSON 文件如下所示:
"example":{
"tab":{
"firstValue": "someValue"
}
}
setTranslation 函数调用如下:
this.translateService.setTranslation('es', {
"example": {
"tab": {
"firstValue": "otherValue",
}
},
});
这个:
this.translateService.get("example.tab.firstValue").subscribe(response => {
console.log(response);
});
总是返回"someValue",但它应该返回更新的值 - "otherValue"
我做错了什么?