I've tried to be clever about this many times, and it always ends up in a
huge mess. So instead of trying to detect the exact issue, I will rather
just tell the user what needs to be done:
% if (validation->has_error('username') {
<p class="help"><%=l 'You need to fill in a username, which needs to
be...' %></p>
% }
The "<%=l' part is the same as <%= l('you need to...') %>, I just like to
write it a "funny" way. The l() helper needs to do the actual translation
for you, as you would with any other string in your application.
On Sunday, February 18, 2018 at 9:13:38 AM UTC+1, Miguel Prz wrote:
>
> I am using Mojolicious::Validator::Validation in my Web app.
> I have to translate the error messages, for example "required" should be
> "requerido" (spanish).
> How can I do this?
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.