Hey all. I’m developing a multilingual site. I want to set a variable and reload the current route on click of a button. This will trigger a reload with the correct language. It’s not a plugin for they don’t really do the language how I like.
Any tips on the ‘way to go’ to do this? You can set a variable in twig, but I believe that is the wrong location. My guess is towards a route and controller action?
EDIT:
I can add e.g. $_SESSION['strLocale'] = 'en_US';
to a action. It works, but the render seems to be done before the session is set for I need to click twice. So I need a function that does this, and then reloads the current route. I’m avoiding translated urls (in this case I don’t need that)