Messages translation
michelts <[email protected]>
| Newsgroups | gmane.comp.python.formencode |
|---|---|
| Message-ID | <[email protected]> |
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
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV