Validation error messages keep being loaded from system |
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?
Enrique
https://beza.com.ar
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 (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.
Enrique
https://beza.com.ar
Check locale in Request? dd(request()); in Controller. You may be overwriting the locale in the filter
Simple CI 4 project for beginners codeigniter-expenses
(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:
Enrique
https://beza.com.ar
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')
Simple CI 4 project for beginners codeigniter-expenses
|
Welcome Guest, Not a member yet? Register Sign In |