This allows to override the language given by the SEF segment via a query variable.
How to test
Open a page on a multilang site. Append ?lang= to the URL with a sef-code different to the current language. See that still the language of the SEF prefix is loaded.
Apply patch.
Do the same as in 1. and see that the language of the query parameter is loaded.
it works
This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6399.