Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Langauge event listener

Featured Replies

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.

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

  • 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!

  • 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 by rbrtsmith

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.