June 1, 201511 yr In chrome or other browsers with built in language translation is there a way to detect if a user has translated a page post page-load. Issue being that I have written an equal-heights plugin that breaks if the text grows in size after translation. So I need to detect if a translate event occurs then re-call the equal heights function. Any ideas? Googling doesn't throw much up.
June 1, 201511 yr Can you run a check against an element to see if the text has changed? Probably not the most efficient solution, though... http://stackoverflow.com/questions/12894222/google-translate-widget-translation-complete-callback
June 1, 201511 yr Author Can you run a check against an element to see if the text has changed? Probably not the most efficient solution, though... http://stackoverflow.com/questions/12894222/google-translate-widget-translation-complete-callback Good idea. But some languages use the same words so it's not 100% reliable and yes as you put it's a little inefficient but probably not noticeably so. The last answer in that thread sounds interesting. It would be nice if the browser actually fired an event, that would be the sensible thing to do.
June 1, 201511 yr Author I'm with Lyndsey on this, I'd find a word that is different across the languages and sniff on that. Time to find that word, and throw it on a hidden element somewhere then sniff at that. Could work. Just need to find such a word!
June 2, 201511 yr Author That classname change was exactly what I wanted to see. That makes this pretty straightforward now! Thanks! A shame we have to do some messy code to detect the classname change but it appears there's no event fired for a classname change. Edited June 2, 201511 yr by rbrtsmith
Create an account or sign in to comment