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 badges
Add a comment  | 

1 Answer 1

Reset to default 0

The 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.

本文标签: