Locale change widget - Is it possible to add a live component that puts a value into the session and then reloads the page?

Hi Jacopo, Merry Christmas!

I created a gist out of some code I wrote for managing a multi-locale Phoenix LiveView project:

If memory serves me well, we cannot change the session from LiveView (see also a recent post Any way to store auth details in cookies using phoenix liveview - #2 by josevalim).

The solution I use in the gist involves updating the session via Plug, and reading/sharing the locale between Plug (available in controllers) and LiveView using a global on_mount hook.

Hope that helps!