以下是代码:
var newScript = document.createElement('script');
newScript.type = 'text/javascript';
var sourceText = escape(document.getElementById("sourceText").innerHTML);
var source = 'https://translation.googleapis.com/language/translate/v2?key=AIzaSyC24dCfm2u_pdXO3KOSBNdq0cBYJubKyS8&source=zh-CN&target=zh-TW&callback=translateText&q=' + sourceText;
newScript.src = source;
// When we add this script to the head, the request is sent off.
document.getElementsByTagName('head')[0].appendChild(newScript); 它以前在sourceText变量中从中文简体中返回中文繁体。现在它返回以下内容。
有人能让我知道谷歌改变了什么吗?打招呼。时间
sourceText:
钴蓝控股有限公司(美国证券交易所代码:COB)2017年年3月季度活动和现金流报告
从翻译API返回的文本:
钴蓝控股有限公司(ASX:COB) 2017%u5E743%u6708%u5B63%u5EA6%u6D3B%u52A8%u548C%u73B0%u91D1%u6D41%u62A5%u544A
https://stackoverflow.com/questions/43752056
复制相似问题