【发布时间】:2018-04-01 14:20:36
【问题描述】:
我正在使用@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"
我做错了什么?
【问题讨论】:
标签: angular translate ngx-translate