Ticket #16403: django-comments-ungettext.2.diff

File django-comments-ungettext.2.diff, 1.0 KB (added by Ferry Jérémie <ferryjeremie@…>, 13 years ago)
  • django/contrib/comments/forms.py

     
    186186        if settings.COMMENTS_ALLOW_PROFANITIES == False:
    187187            bad_words = [w for w in settings.PROFANITIES_LIST if w in comment.lower()]
    188188            if bad_words:
    189                 plural = len(bad_words) > 1
    190189                raise forms.ValidationError(ungettext(
    191190                    "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')))
    194193        return comment
    195194
    196195class CommentForm(CommentDetailsForm):
Back to Top