Jan Niklas Fingerle schrieb:

> As long as I roll my own validation, write my own validation schema
> and so on, this is true. But I can't see how I can pass a 'message'
> attribute to validators that are called implicitly in form widgets.
> These are not too many (one Bool() and one Int(), if my count is correct),
> but nonetheless I'd like to have these localized. What am I missing?

A hack could be:

>>> i = validators.Int()
>>> i._messages['integer'] = "test"
>>> i.to_python("nointeger")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File
"/usr/lib/python2.4/site-packages/FormEncode-0.5.1-py2.4.egg/formencode/api.py",
line 322, in to_python
    value = tp(value, state)
  File
"/usr/lib/python2.4/site-packages/FormEncode-0.5.1-py2.4.egg/formencode/validators.py",
line 906, in _to_python
    value, state)
formencode.api.Invalid: test


But FormEncode should support i18n for itself and in companion with TG.
Maybe I find the time to do it. But I don't know yet.

--
Gregor

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to