PHP语言转换器
我有一个脚本,我正在使用它将英语文本转换为其他口语,我有一个php代码处理它,就像这样PHP语言转换器,php,translate,Php,Translate,我有一个脚本,我正在使用它将英语文本转换为其他口语,我有一个php代码处理它,就像这样 ini_set("max_execution_time", "300"); header('Content-Type: text/html; charset=utf-8'); require_once('googleTranslate.class.php'); $gt = new Google_Translate_API(); $title = $gt->translate($title, "en",
ini_set("max_execution_time", "300");
header('Content-Type: text/html; charset=utf-8');
require_once('googleTranslate.class.php');
$gt = new Google_Translate_API();
$title = $gt->translate($title, "en", $lang);
$keywords = $gt->translate($keywords, "en", $lang);
$body = $gt->translate($body, "en", $lang);
不管怎样,当我运行这个脚本时,它在能够翻译很多文本之前就超时了,所以我想知道我们是否可以一次运行一个片段
另外,请注意googleTranslate.class.php可以从Google代码免费下载
干杯嗯,我想你首先应该缓存结果。制作一些脚本以缓存所需语言的翻译内容。否则你的速度将达到查询限制。明白了。事实证明,谷歌翻译API不是一个好办法。相反,我使用的是Bing翻译服务。它也没有限制我的文本长度。谢谢你的帮助 翻译三段文字时超时?可以免费下载,但服务器端API不再免费:Google Translate API v2现在作为付费服务提供。2011年8月24日之前创建的现有Translate API v2项目的礼貌限制将于2011年12月1日降至零。。。Google Translate API v1将于2011年12月1日完全关闭: