ojengwa / django-simple-captcha

Automatically exported from code.google.com/p/django-simple-captcha
MIT License
1 stars 0 forks source link

Support for languages #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I recently started using simple-captcha and found a problem with overriding
text "Invalid Captcha" (I'm creating site in polish so this text looks a
little bit weird).

I found no solution to solve this problem so I modify class CaptchaField
from file fields.py. I added dictionary:
default_error_messages = {'invalid': _('Invalid CAPTCHA')}
and modify line 64 (65 after addition dictionary) to:
raise ValidationError(self.error_messages['invalid'])

From now programmers can specify alternative text passing a parameter like
this:
CaptchaField(error_messages={"invalid": "Incorrectly rewritten text"})

I think it is a good way to support alternative texts so I suggest you to
include this in next release or if there is other way to change this text
write somewhere about it. ;-)

Cheers and thanks for great work. :-)

Original issue reported on code.google.com by arr...@gmail.com on 4 Nov 2009 at 1:08

GoogleCodeExporter commented 9 years ago
Thanks for your feedback, this is fixed in SVN and in release 0.1.2

Original comment by mbonetti on 4 Nov 2009 at 1:53