Click here to Skip to main content
15,886,830 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,
I have added custom flags to my website which toggles google translate by refreshing the website on the following example: www.siteurl.com/#googtrans(en|fr)
Everything works fine but I just cannot seem to disable Google Translate from that point. Obviously it's possible through the added navigation but I'd like to do so by using my own british flag so I've tried stuff like #googtrans(en|en) or #googtrans(en) but that doesn't work. Any idea how to solve that problem?
I've google a lot but couldnt find anything.. :-(

Thank you very much!
Posted
Comments
Dennis Baberich 10-Oct-15 21:42pm    
I'd like to know this too. Did you figure it out?

1 solution

I couldn't find anything in the help docs myself.

Here's a quick hack, though.

JavaScript
jQuery.removeCookie('googtrans', { path: 'www.baberich.de' });
jQuery.removeCookie('googtrans', { domain: '.baberich.de' });
window.document.location.href = "/";


You can just remove Google's cookies and it will get rid of the translation after a site refresh. Make sure you do not refresh with the #googletrans(en|fr)!

I am using jquery-cookie[^]

for cookie manipulation, you can use whatever, though.
 
Share this answer
 
v2
Comments
Marianne Markwardt 12-Oct-15 8:37am    
Well. Since we have not found any real solution to it anyway, I might just go this way. Thank you very much Dennis :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900