What is the best way to detect the language of User? I have in my application a dropdownlist where the User can select the application language (English or Portuguese), internationalization works well, however only after logging in.
I would like the login screen, the system was already presented in the correct User language (for example based on browser language).
Is it correct to do so? How could it be done?
EDIT
I got following this article: https://github.com/samdark/yii2-cookbook/blob/master/book/i18n-selecting-application-language.md