diff --git a/AUTHORS b/AUTHORS index 35e5b08b1b..c690980c90 100644 --- a/AUTHORS +++ b/AUTHORS @@ -128,6 +128,7 @@ answer newbie questions, and generally made Django that much better: Owen Griffiths Espen Grindhaug Thomas Güttler + dAniel hAhler Brian Harring Brant Harris Hawkeye diff --git a/django/core/validators.py b/django/core/validators.py index 717262a065..8a93462b21 100644 --- a/django/core/validators.py +++ b/django/core/validators.py @@ -272,7 +272,7 @@ def hasNoProfanities(field_data, all_data): plural = len(words_seen) raise ValidationError, ungettext("Watch your mouth! The word %s is not allowed here.", "Watch your mouth! The words %s are not allowed here.", plural) % \ - get_text_list(['"%s%s%s"' % (i[0], '-'*(len(i)-2), i[-1]) for i in words_seen], 'and') + get_text_list(['"%s%s%s"' % (i[0], '-'*(len(i)-2), i[-1]) for i in words_seen], _('and')) class AlwaysMatchesOtherField(object): def __init__(self, other_field_name, error_message=None): diff --git a/django/utils/text.py b/django/utils/text.py index c41c35151b..4670ab47fa 100644 --- a/django/utils/text.py +++ b/django/utils/text.py @@ -2,6 +2,7 @@ import re from django.conf import settings from django.utils.encoding import force_unicode from django.utils.functional import allow_lazy +from django.utils.translation import ugettext_lazy # Capitalizes the first letter of a string. capfirst = lambda x: x and force_unicode(x)[0].upper() + force_unicode(x)[1:] @@ -123,7 +124,7 @@ def get_valid_filename(s): return re.sub(r'[^-A-Za-z0-9_.]', '', s) get_valid_filename = allow_lazy(get_valid_filename, unicode) -def get_text_list(list_, last_word=u'or'): +def get_text_list(list_, last_word=ugettext_lazy(u'or')): """ >>> get_text_list(['a', 'b', 'c', 'd']) 'a, b, c or d'