![]() |
PHP 8.1, CodeIgniter 4.3.7 fresh instalation, production mode.
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 + "ajskldf", and see 404 error page: Code: 404 - File Not Found I try: PHP Code: $ php spark x I see the error message translated: Code: CodeIgniter v4.3.7 Command Line Tool - Server Time: 2023-08-22 10:09:35 UTC+02:00 I know in develop mode this message is hard coded, but message is diferent, is like: Code: 404 - File Not Found I'm talking about production mode 404 not being translated.
See https://github.com/codeigniter4/translat...anguage/es
There is no translation for Errors.pageNotFound.
Indeed there is no file called Errors. But in HTML.php (https://github.com/codeigniter4/translat...s/HTTP.php) we have:
Code: // Page Not Found in previous version of framework worked as spected. In 4.2.0 and 4.2.1 there was a bug: https://forum.codeigniter.com/showthread.php?tid=82276 and was fixed in 4.2.2: https://github.com/codeigniter4/CodeIgniter4/pull/6202 But now, I'm testing 4.3.7 and fails again I don't know why.
It is because there is no translation for Errors.pageNotFound.
Forget about 4.2.
Just for other people reference:
For 404 not found locale, is needed a file called app/Languages/XX/Errors.php with the following 4 strings: Code: return [ Although translation site release is for 4.3.6 there are plenty of languages without this file. Thank you, kenjis, for pointing me in the right direction. |
Welcome Guest, Not a member yet? Register Sign In |