Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #5156 -- Added some translation calls to a couple of missed wor…

…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...
commit ce151bb8e413a344627e29d3c1599ff06da672f2 1 parent f0ca553
Malcolm Tredinnick authored August 15, 2007
1  AUTHORS
@@ -128,6 +128,7 @@ answer newbie questions, and generally made Django that much better:
128 128
     Owen Griffiths
129 129
     Espen Grindhaug <http://grindhaug.org/>
130 130
     Thomas Güttler <hv@tbz-pariv.de>
  131
+    dAniel hAhler
131 132
     Brian Harring <ferringb@gmail.com>
132 133
     Brant Harris
133 134
     Hawkeye
2  django/core/validators.py
@@ -272,7 +272,7 @@ def hasNoProfanities(field_data, all_data):
272 272
         plural = len(words_seen)
273 273
         raise ValidationError, ungettext("Watch your mouth! The word %s is not allowed here.",
274 274
             "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'))
276 276
 
277 277
 class AlwaysMatchesOtherField(object):
278 278
     def __init__(self, other_field_name, error_message=None):
3  django/utils/text.py
@@ -2,6 +2,7 @@
2 2
 from django.conf import settings
3 3
 from django.utils.encoding import force_unicode
4 4
 from django.utils.functional import allow_lazy
  5
+from django.utils.translation import ugettext_lazy
5 6
 
6 7
 # Capitalizes the first letter of a string.
7 8
 capfirst = lambda x: x and force_unicode(x)[0].upper() + force_unicode(x)[1:]
@@ -123,7 +124,7 @@ def get_valid_filename(s):
123 124
     return re.sub(r'[^-A-Za-z0-9_.]', '', s)
124 125
 get_valid_filename = allow_lazy(get_valid_filename, unicode)
125 126
 
126  
-def get_text_list(list_, last_word=u'or'):
  127
+def get_text_list(list_, last_word=ugettext_lazy(u'or')):
127 128
     """
128 129
     >>> get_text_list(['a', 'b', 'c', 'd'])
129 130
     'a, b, c or d'

0 notes on commit ce151bb

Please sign in to comment.
Something went wrong with that request. Please try again.