Need to implement a competent redirect redirect to a page with the correct language.
Ie we have a site: site.ru
It has 2 languages: site.ru/ru and site.ru/en, respectively.
It is required that when entering the site.ru, the language should be correctly selected, and redirected to the appropriate section of the language, the site.ru/ru or site.ru/en
also, if the user for some reason switched to the site.ru/news, or the site.ru/news/today he was also transferred to the corresponding page with the language site.ru/{ru or en}/news and site.ru/{ru or en}/news/today respectively
It is also required to save the post request, that is, if there was a request to the site.ru?User=1, should redirect the site.ru/{ru or en}?User=1
Multilingualism on the site is implemented, the corresponding language is written in dispatch: beforeExecuteRoute in this way: $ session-> set('lang', $lang);
At the moment, everything has been done with a crutch. If there is no language in the address (ru or en), then we redirect to the controller that determines the language from the session ($ this-> session-> get ('lang');) and then simply transfer it to the corresponding language.