Update widget locale

Is there any way to force the widget to update when the UPLOADCARE_LOCALE setting is updated? We need the ability to update all text throughout the app when the user changes their locale. I’m not seeing the translations in the widget change after updating the global setting.

@developers by default, the locale doesn’t change dynamically when you update the value of the UPLOADCARE_LOCALE variable. However, there is a bit tricky way that rebuilds the widget with the updated locale settings. You can find a working demo here
https://codepen.io/bautrukevich/pen/MzzegZ

Hope that helps.

This is working for us! Thanks so much for the workaround!

1 Like

Well it’s sort of working… it seems that the file and camera tabs update their translations but the other tabs we are using (gphotos, instagram and facebook) don’t update.

@developers, yes that’s true. This way of changing the locale is a kind of a “hack,” and it doesn’t affect text captions in cloud/social tabs which are rendered within an iframe.

Hopefully, we’ll implement a proper locale updating in the next major version of the widget we’re working on.

Ok thanks for the details! We look forward to that feature!

Here is an advanced version of this script that allows you to change the locale in remote tabs as well :slight_smile: Still a hack, though.