Ticket #8879: contrib-comments-ungettext.diff

File contrib-comments-ungettext.diff, 1.1 KB (added by Jarek Zgoda, 16 years ago)

Patch to replace call to ngettext() where ungettext() should be used

  • django/contrib/comments/forms.py

     
    1111from django.utils.encoding import force_unicode
    1212from django.utils.hashcompat import sha_constructor
    1313from django.utils.text import get_text_list
    14 from django.utils.translation import ngettext
     14from django.utils.translation import ungettext
    1515from django.utils.translation import ugettext_lazy as _
    1616
    1717COMMENT_MAX_LENGTH = getattr(settings,'COMMENT_MAX_LENGTH', 3000)
     
    122122            bad_words = [w for w in settings.PROFANITIES_LIST if w in comment.lower()]
    123123            if bad_words:
    124124                plural = len(bad_words) > 1
    125                 raise forms.ValidationError(ngettext(
     125                raise forms.ValidationError(ungettext(
    126126                    "Watch your mouth! The word %s is not allowed here.",
    127127                    "Watch your mouth! The words %s are not allowed here.", plural) % \
    128128                    get_text_list(['"%s%s%s"' % (i[0], '-'*(len(i)-2), i[-1]) for i in bad_words], 'and'))
Back to Top