Ticket #8879: contrib-comments-ungettext.diff
File contrib-comments-ungettext.diff, 1.1 KB (added by , 16 years ago) |
---|
-
django/contrib/comments/forms.py
11 11 from django.utils.encoding import force_unicode 12 12 from django.utils.hashcompat import sha_constructor 13 13 from django.utils.text import get_text_list 14 from django.utils.translation import ngettext14 from django.utils.translation import ungettext 15 15 from django.utils.translation import ugettext_lazy as _ 16 16 17 17 COMMENT_MAX_LENGTH = getattr(settings,'COMMENT_MAX_LENGTH', 3000) … … 122 122 bad_words = [w for w in settings.PROFANITIES_LIST if w in comment.lower()] 123 123 if bad_words: 124 124 plural = len(bad_words) > 1 125 raise forms.ValidationError( ngettext(125 raise forms.ValidationError(ungettext( 126 126 "Watch your mouth! The word %s is not allowed here.", 127 127 "Watch your mouth! The words %s are not allowed here.", plural) % \ 128 128 get_text_list(['"%s%s%s"' % (i[0], '-'*(len(i)-2), i[-1]) for i in bad_words], 'and'))