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

(07-27-2024, 09:02 AM)PhilInLoco Wrote: 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.

@PhilInLoco Glad you find my post usefull.

The question in my previous post still remain, maybe some CI guru here could helpĀ  Wink

"If anyone know a better way, please advises".
Reply


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



Theme © iAndrew 2016 - Forum software by © MyBB