Welcome Guest, Not a member yet? Register   Sign In
setLocale() doesn't change the language set by browser
#6

Thank your eelisland!
I was calling service('language')->setLocale('currentLocale) just before calling the views, but that didn't work when the view has a link to another page. Your solution is much more elegant works all the time!
My only concern with your solution is that I am setting the locale at each method call, which is not necessary most of the time...
I just do not understand why there is not a way to set the current locale once for all, and why it gets reset all the time to the default or negotiated one.
I used to work with CakePHP and setting it once was enough.
Reply


Messages In This Thread
RE: setLocale() doesn't change the language set by browser - by PhilInLoco - 07-27-2024, 09:02 AM



Theme © iAndrew 2016 - Forum software by © MyBB