admin管理员组文章数量:1122832
My site uses a plugin (Google Language Translator) to apply a Google translation of the text (see page here--the flags at the top of the page switch the language). If I change to another language, close the browser, re-open the browser, and re-open my page, the same language is displayed. How does the browser know to display in the same language as before?
Is there some variable set somewhere? Perhaps a cookie, or session ID? Or perhaps some kind of JavaScript variable? I've looked through the source code, but can't see anything obvious.
I have tried contacting the plugin developer, but they have not responded :-/
The motivation for my question is because I have now used a separate plugin (WPML) to create a manual French translation of my site. But when a visitor switches between the Google translations and this manual French site, there are issues. For example, if a visitor switches to Chinese, then tries to access the French site, the page is displayed like so. On first glance, it appears that the browser continues to think a Chinese Google translation needs to be applied.
My site uses a plugin (Google Language Translator) to apply a Google translation of the text (see page here--the flags at the top of the page switch the language). If I change to another language, close the browser, re-open the browser, and re-open my page, the same language is displayed. How does the browser know to display in the same language as before?
Is there some variable set somewhere? Perhaps a cookie, or session ID? Or perhaps some kind of JavaScript variable? I've looked through the source code, but can't see anything obvious.
I have tried contacting the plugin developer, but they have not responded :-/
The motivation for my question is because I have now used a separate plugin (WPML) to create a manual French translation of my site. But when a visitor switches between the Google translations and this manual French site, there are issues. For example, if a visitor switches to Chinese, then tries to access the French site, the page is displayed like so. On first glance, it appears that the browser continues to think a Chinese Google translation needs to be applied.
Share Improve this question asked Oct 9, 2017 at 10:40 cag8fcag8f 1,9973 gold badges20 silver badges31 bronze badges1 Answer
Reset to default 0The replies in this outside thread led me to discover that a cookie is indeed being set in the browser that instructs a Google translation to be applied. This is the information I was after.
edit: Specifically, the plugin displays the Google Language Bar on my site. When a visitor uses this language bar to switch the language of the page, a googtrans
cookie is set on my page, corresponding to the indicated language (screenshot). As I understand, the cookie is added by an external script hosted by Google, not by the plugin. So I cannot delete the cookie, or cause it to expire.
本文标签:
版权声明:本文标题:I have a plugin that applies a Google translation to my page--how does the browser know which language to display? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736281566a1926359.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论