Fce setLocale() does not work properly on the server |
I use the setLocale () function to set the language of the error messages.
it works well on localhost (win, xampp), but not on server (unix). in app.php is set: PHP Code: public $defaultLocale = 'en'; in controler is set: PHP Code: $this->request->setLocale('cs'); On localhost is error messages in 'cs', but on server only in 'en'. I listed the request PHP Code: var_dump($this->request); Code: ["locale":protected]=> string(2) "cs" Code: ["locale":protected]=> string(2) "en" please, give me an advice
What's the value of $negotiateLocale? Maybe it switch to EN because it auto-detect the language.
Maybe take a look at my tutorial for multilingual website with CI4. It covers the basics and a little more: https://includebeer.com/en/blog/creating...r-4-part-1
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/ |
Welcome Guest, Not a member yet? Register Sign In |