누군가가 도울 수 있기를 바랍니다. 나는 마법의 거울에서 번역 작업을하고있다. 날씨 모듈의 내부 node_helper.js를 사용합니다. 코드를 보여 드리겠습니다 :나는 약속의 물건으로 미쳤어.
if (this.config.lang != 'en'){
console.log("in Translate");
translate(alerts.description, {to: this.config.lang}).then((res) => {console.log(res.text); return res;});
translate(alerts.expires, {to: this.config.lang}).then(res => {console.log(res.text)});
translate(alerts.message, {to: this.config.lang}).then(res => {console.log(res.text)});
}
등등. config.log를 살펴보면 모든 결과를 볼 수 있지만 다음 코드에서 사용할 수 없습니다 .,,, 도움말을 참조하십시오
을, 기능이 구글에서이고 당신이 도움이하고자하는 문제가 무엇 약속 –
을 반환 번역? – jfriend00
내가 말했듯이, 번역의 출력이 올바르게 console.log에 표시되지만 코드 변환 후 3 호출이 내 문제입니다 –