The default language of my application is pt_BR. When a person accesses the application for the first time, the getBrowserLocale function in the SwitchLanguageLocale middleware returns 'en' as the browser language.
Testing locally, I saw that the problem is that the variable "HTTP_ACCEPT_LANGUAGE" returns pt-BR instead of pt_BR
("pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7")
I override the class, changing the following line:
Hi,
The default language of my application is pt_BR. When a person accesses the application for the first time, the getBrowserLocale function in the SwitchLanguageLocale middleware returns 'en' as the browser language. Testing locally, I saw that the problem is that the variable "HTTP_ACCEPT_LANGUAGE" returns pt-BR instead of pt_BR ("pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7")
I override the class, changing the following line:
$appLocales = strreplace('','-',LanguageSwitch::make()->getLocales());
But I believe it is not the best solution. Could you check the best solution and make the correction?