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

PHP shares nothing between requests.
So if you keep something, you need to persist it with something like Session, Database, ....
So if you want to change the locale from the default one, you need to set it in every request.

service('language') gets the locale from the IncommingRequest instance.
So if you change the locale in IncommingRequest before the first call for service('language'),
the request locale is set.
Reply


Messages In This Thread
RE: setLocale() doesn't change the language set by browser - by kenjis - 07-27-2024, 06:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB