defaultLocale no effect |
06-29-2022, 12:59 AM
(This post was last modified: 06-29-2022, 08:36 AM by Arquero. Edit Reason: typo )
PHP 7.4.28, CodeIgniter 4.1.9 fresh instalation.
Copy "es" folder from languages zip to "app/Language" and change "app/Config/App.php" that way: PHP Code: public $defaultLocale = 'es'; In browser go to URL + "añslkjfañ", and see 404 error page translated. The exact same thing with CodeIgniter 4.2.1 and 404 error page is still in english and no way to see it translated. Bug? Missconfiguratión? I forget something to do in new version? No new autoroutes enabled, I just upload zip file and set "writable" folder writable, nothing else just the changes related to language en "app/Config/App.php" so easily replicable. Thanks for your time.
It seems a bug.
Try spark command: Code: $ php spark x If the lang files are correctly installed and configured, you can see a translated error message.
The bug was fixed in develop branch, and it will be included in v4.2.2.
https://github.com/codeigniter4/CodeIgniter4/pull/6202
In development environment, the error message is hard coded. So you can't translate it.
|
Welcome Guest, Not a member yet? Register Sign In |