Validation error messages keep being loaded from system - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Validation error messages keep being loaded from system (/showthread.php?tid=90832) |
Validation error messages keep being loaded from system - kabeza - 05-10-2024 Hi I'm trying to translate the error messages from Validation service: I've set in app/Config/App.php Code: public string $defaultLocale = 'es'; I've also created (as stated in userguide) the folder and file Code: app/Language/es/Validation.php But the error messages keep being loaded from vendor/codeigniter4/framework/system/Language/en/Validation.php (I've confirmed this by changing strings there and trying again) Am I ignoring anything else? RE: Validation error messages keep being loaded from system - ALTITUDE_DEV - 05-10-2024 Hi do you have follow this steps : Step 1. in your App.php set defaultlocale + supportedLocales Step 2. make a file in app/Languages/es/Validation.php example: PHP Code: <?php RE: Validation error messages keep being loaded from system - kabeza - 05-10-2024 (05-10-2024, 07:27 AM)ALTITUDE_DEV Wrote: Hi do you have follow this steps : Yes, I've followed the steps from userguide etc. RE: Validation error messages keep being loaded from system - ozornick - 05-10-2024 Check locale in Request? dd(request()); in Controller. You may be overwriting the locale in the filter RE: Validation error messages keep being loaded from system - kabeza - 05-13-2024 (05-10-2024, 09:13 AM)ozornick Wrote: Check locale in Request? dd(request()); in Controller. You may be overwriting the locale in the filter The value for locale is correct, it is "es" The process I do in the controller is just Code: RE: Validation error messages keep being loaded from system - ozornick - 05-13-2024 I don't understand what the reason is. All right. In such difficult cases, I perform the debug of the system files. Let's say you need to track where the language is being reset. Try dd(...) variables in lang() >> and deeper in code. And try lang('Validation.alpha', [], 'es') |