Hello, I need to translate this line when doing row validation: 'There was an error on row :row. :message' (Laravel-Excel/src/Validators/Failure.php)
Do I need to override the function toArray()?
Using customValidationMessages() only affects :message.
I think you can just add "There was an error on row :row. :message": "Your translation" to your json translate file (https://laravel.com/docs/5.8/localization#using-translation-strings-as-keys)
Ok, currently I have a validation.php file for all laravel validation messages inside resources/lang/my_lang/:
'required' => 'El campo :attribute es obligatorio.'
and a my_lang.json file for custom strings:
"There was an error on row :row. :message": "Hubo un error en la fila :row. :message"
Now using rule 'name' => ['required', 'string', 'max:255'], outputs: Hubo un error en la fila 2. El campo email es obligatorio.
Thanks.
Most helpful comment
I think you can just add
"There was an error on row :row. :message": "Your translation"to your json translate file (https://laravel.com/docs/5.8/localization#using-translation-strings-as-keys)