Ticket #16403: django-comments-ungettext.2.diff
File django-comments-ungettext.2.diff, 1.0 KB (added by , 13 years ago) |
---|
-
django/contrib/comments/forms.py
186 186 if settings.COMMENTS_ALLOW_PROFANITIES == False: 187 187 bad_words = [w for w in settings.PROFANITIES_LIST if w in comment.lower()] 188 188 if bad_words: 189 plural = len(bad_words) > 1190 189 raise forms.ValidationError(ungettext( 191 190 "Watch your mouth! The word %s is not allowed here.", 192 "Watch your mouth! The words %s are not allowed here.", plural) % \193 get_text_list(['"%s%s%s"' % (i[0], '-'*(len(i)-2), i[-1]) for i in bad_words], 'and'))191 "Watch your mouth! The words %s are not allowed here.", len(bad_words)) % \ 192 get_text_list(['"%s%s%s"' % (i[0], '-'*(len(i)-2), i[-1]) for i in bad_words], _('and'))) 194 193 return comment 195 194 196 195 class CommentForm(CommentDetailsForm):