I verify that the user language has hooked the detection in post_controller_constructor and I set it somewhere on a global scale (for example, changing the language in the configuration file at run time). The controller should just use the value.
Language detected with next check in backup
- was it set using the GET parameter (e.g.? lang = en)?
- was it set in cookie?
- What is the language offered by the browser?
- use the default language
If the language is not supported, use the default value. Set or update the cookie with the new data.
This way, you usually donβt need to use the GET parameter, evenly just once, if the user clicks somewhere to change the language
source share