On Jan 20, 6:44 pm, "hamdy.a.farag" <hamdy.a.fa...@inbox.com> wrote:
> Thank you Denzel for replying
>
> for the IS_EXPR(), In fact I did my own validator that does what I
> need
> It's nice though to know about "onvalidation" which makes life easier
>
> For the other translation problem, I guess after all that error
> messages where ever they're should be made easy to
> translate , this makes sense and make it easier to use web2py
> so if some validators can't have their error messages be translated,
> this makes me create my own validators every time I can't have them
> translated and the new validators will be just a copy/paste code from
> the original validators
> except for the custom error message, and this's not good .
>
> web2py has a policy to make error messages be easily to translate and
> you can't just omit that for some validators
> because after a whie you'll end up with too many validators like
> that , this will enforce users to re-create their own validators , and
> this is not what web2py is a bout any way .
>
> So I my self vote for a change to make those validators error_messages
> can be translated easily
>
> Thank you

web2py is not stopping you from translating the error message, it
stops you from changing the min and max values.

So you can do
IS_INT_IN_RANGE(v1, v2, error_message=T("enter a value between %(min)s
and %(max)s"))
or any other string containing the min and max mapping keys,

but not
IS_INT_IN_RANGE(v1, v2, error_message=T("enter a value between %(min)s
and %(max)s" %dict(min=str(v1), max=str(v2+1))))

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.


Reply via email to