Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixes #1066 - yesno used the wrong way to do translations

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1673 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 3c4c6e0f965f4523089c4700c4d2219902c803f0 1 parent 2b50cb8
Georg Bauer authored
Showing with 6 additions and 3 deletions.
  1. +6 −3 django/core/template/defaultfilters.py
View
9 django/core/template/defaultfilters.py
@@ -2,6 +2,7 @@
from django.core.template import resolve_variable, Library
from django.conf.settings import DATE_FORMAT, TIME_FORMAT
+from django.utils.translation import gettext
import re
import random as random_module
@@ -351,7 +352,7 @@ def divisibleby(value, arg):
"Returns true if the value is devisible by the argument"
return int(value) % int(arg) == 0
-def yesno(value, arg=_("yes,no,maybe")):
+def yesno(value, arg=None):
"""
Given a string mapping values for true, false and (optionally) None,
returns one of those strings accoding to the value:
@@ -365,7 +366,9 @@ def yesno(value, arg=_("yes,no,maybe")):
``None`` ``"yeah,no"`` ``"no"`` (converts None to False
if no mapping for None is given.
========== ====================== ==================================
- """
+ """
+ if arg is None:
+ arg = gettext('yes,no,maybe')
bits = arg.split(',')
if len(bits) < 2:
return value # Invalid arg.
@@ -470,4 +473,4 @@ def pprint(value):
register.filter(urlizetrunc)
register.filter(wordcount)
register.filter(wordwrap)
-register.filter(yesno)
+register.filter(yesno)
Please sign in to comment.
Something went wrong with that request. Please try again.