Skip to content

Commit

Permalink
Fixed #5156 -- Added some translation calls to a couple of missed wor…
Browse files Browse the repository at this point in the history
…ds. Based on a patch from dAniel hAhler.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5895 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
malcolmt committed Aug 15, 2007
1 parent f0ca553 commit ce151bb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ answer newbie questions, and generally made Django that much better:
Owen Griffiths
Espen Grindhaug <http://grindhaug.org/>
Thomas Güttler <hv@tbz-pariv.de>
dAniel hAhler
Brian Harring <ferringb@gmail.com>
Brant Harris
Hawkeye
Expand Down
2 changes: 1 addition & 1 deletion django/core/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion django/utils/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
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:]
Expand Down Expand Up @@ -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'
Expand Down

0 comments on commit ce151bb

Please sign in to comment.