We have a portal site, that is embedded via iframe inside a typo3 website. We want the portal inside the iframe to show the content in the same language as the parent typo3 page does. Therefore we planned to pass a url parameter to the portal page inside the iframe, i.e. "?lcid=1031" or "?lang=en". Inside the portal page we then want to process the url parameter and switch the language. But how to do this? I didn't find any documentation about that topic and it is not quite obvious what that default language switcher control does.

What happens technically when another language is selected and how to emulate that behavior manually? Is there maybe an official url parameter that can be used?