Ticket #5156: django-i18n-for-get_text_list.diff

File django-i18n-for-get_text_list.diff, 1.2 KB (added by dAniel hAhler, 17 years ago)

Patch against trunk/r5883

  • django/core/validators.py

     
    272272        plural = len(words_seen)
    273273        raise ValidationError, ungettext("Watch your mouth! The word %s is not allowed here.",
    274274            "Watch your mouth! The words %s are not allowed here.", plural) % \
    275             get_text_list(['"%s%s%s"' % (i[0], '-'*(len(i)-2), i[-1]) for i in words_seen], 'and')
     275            get_text_list(['"%s%s%s"' % (i[0], '-'*(len(i)-2), i[-1]) for i in words_seen], _('and'))
    276276
    277277class AlwaysMatchesOtherField(object):
    278278    def __init__(self, other_field_name, error_message=None):
  • django/utils/text.py

     
    123123    return re.sub(r'[^-A-Za-z0-9_.]', '', s)
    124124get_valid_filename = allow_lazy(get_valid_filename, unicode)
    125125
    126 def get_text_list(list_, last_word=u'or'):
     126def get_text_list(list_, last_word=_('or')):
    127127    """
    128128    >>> get_text_list(['a', 'b', 'c', 'd'])
    129129    'a, b, c or d'
Back to Top