谷歌翻译API有时不响应

发布于 2024-10-17 02:28:32 字数 284 浏览 7 评论 0原文

I am using http://ajax.googleapis.com/ajax/services/language/translate to translate pages on the fly. Sometimes it happens that I get no response from Google and my page displays blank. Is it possible that their service sometimes doesn't respond in timely fashion? Is there a way to overcome it like when I get no response from Google?

I am using PHP.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

-小熊_ 2024-10-24 02:28:32

如果您使用 GET,您的 URL 限制为 2k 个字符,这会提供(至少对我而言)360 个字母的编码文本。如果您使用 POST,您(应该)有 5k 个字母。
如果您超过限制,那么 google 的行为正如您所描述的那样。
我有 发布了 GET 版本的一些 JavaScript 代码

If you are using GET your URL is limited to 2k characters, that gives (at least for me) 360 letters of encoded text. If you are using POST you (should) have 5k letters.
If you go over the limit then google's behaviour is as you describe it.
I have posted some javascript code for the GET version.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文