开发者

How do you tell if Google translator is active?

开发者 https://www.devze.com 2023-03-20 04:14 出处:网络
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:

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:

  1. Is the site currently being viewed through the Google Translate frame?

  2. If so, can I tell which language is开发者_如何学编程 being viewed?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消