|
From: michelts <mic...@gm...> - 2006-07-24 14:48:15
|
Hi guys,
I have a question about translation messages in some validator, now I
extend the class of validator with the translated messages as above:
>>> from formencode.validators import String
>>> class String(String):
... messages = {'empty':'Another message reather than the original'}
...
>>>
The problem is that I have to do it to each validator I have. I
thinking on a idea over message handling on FormEncode, it seems to
get messages following the sequence above:
- from FancyValidator class
- from the specific Validator class (suppose String)
- from an extension of Validator class
- from the keyword messages of a Validator (os extension of Validator) instance
We could put all standard messages on a single file and remove the
setting of messages on specific validators, with this I will edit only
one file to change messages like empty, tooShort, etc. The sequence
will be:
- from the messages file
- from the specific Validator class (the validators at validators.py
will not set messages)
- from an extension of the Validator class
- from the keyword messages of a Validator
What do you think? Any suggestions?
Thanks
--
Michel Thadeu Sabchuk
Curitiba - Brasil
|