![]() |
I'm trying to change the language of my app.
I've tried inside the BaseController in the initController method in several ways PHP Code: $lingua = session('lingua'); or PHP Code: $lingua = session('lingua'); PHP Code: $lingua = session('lingua'); If I try to print these variables on the screen I receive: echo session('language'); returns "en" echo config('App')->defaultLocale; returns "en" echo $this->request->getLocale(); return 'it' If I manually change the value of public string $defaultLocale to 'en' or 'it' everything works and I see the app in the desired language What should I do to be able to change the language dynamically? I don't need the URL changed. |
Messages In This Thread |
Change language dynamically CI 4.4.6 - by serialkiller - 03-13-2024, 07:08 AM
RE: Change language dynamically CI 4.4.6 - by JustJohnQ - 03-13-2024, 08:35 AM
RE: Change language dynamically CI 4.4.6 - by serialkiller - 03-13-2024, 08:44 AM
RE: Change language dynamically CI 4.4.6 - by JustJohnQ - 03-13-2024, 09:00 AM
RE: Change language dynamically CI 4.4.6 - by serialkiller - 03-14-2024, 05:54 AM
|