let text = 'Hello, World!';
let source = 'en';
let target = 'zh-CN';
fetch(`https://translate.googleapis.com/translate_a/single?client=gtx&sl=${source}&tl=${target}&dt=t&q=${text}`)
.then(response => response.json())
.then(data => {
let result = data[0][0][0];
console.log(result);
});