如何判断 Google 翻译是否处于活动状态?
我正在向我的网站添加 Google 翻译链接,但我想根据当前正在查看的语言运行一些 JavaScript。使用 JavaScript,有没有办法确定以下内容:
当前是否通过 Google 翻译框架查看网站?
如果是这样,我可以知道正在查看哪种语言吗?
I'm adding Google Translate links to my website, but I want to run some JavaScript based on the current language being viewed. Using JavaScript, is there a way to determine the following:
Is the site currently being viewed through the Google Translate frame?
If so, can I tell which language is being viewed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,它内置于 Chrome 中,只是包装您的网站,因此您不会知道。您可以检查 HTTP Accept-Language 标头以查看它们来自哪个区域,以便您可以对其进行本地化,但仅此而已。
No, its built into Chrome and just wraps your site so you will have no idea. You can check the HTTP Accept-Language header to see what region they are coming from so you can localize it, but thats about it.