You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I didn't find any way to localise field interpolation in validation messages in models. It looks like a bug. Sorry if I'm wrong. Now I wrote little workaround. I`ll leave it below but in my opinion its looks bad. In CodeIgniter v3 I've loaded two lang files in controller and {field} was replaced to localised value automatically.
Affected module(s)
Model
Validation
Expected behavior, and steps to reproduce if appropriate
File structure:
Language/en/Validation.php:
return ['valid_date' => 'Field {field} is invalid'];
Hello
I didn't find any way to localise field interpolation in validation messages in models. It looks like a bug. Sorry if I'm wrong. Now I wrote little workaround. I`ll leave it below but in my opinion its looks bad. In CodeIgniter v3 I've loaded two lang files in controller and {field} was replaced to localised value automatically.
Affected module(s)
Expected behavior, and steps to reproduce if appropriate
File structure:
Language/en/Validation.php
:Language/en/Entity.php
:Models/MyModel.php
:Now call model validation in controller in controller:
And you've got response
So how to localise
Entity.date
field?Workaround
Context
The text was updated successfully, but these errors were encountered: