Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #4414 -- Fixed Javascript message translation to also work when…

… there is more than one format marker in a string. Thanks, tobias@neuyork.de.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@5849 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 537b16ca97fd3a433a3ce514d8a5659688431cd4 1 parent 9d7dc0c
@malcolmt malcolmt authored
Showing with 3 additions and 2 deletions.
  1. +1 −0  AUTHORS
  2. +2 −2 django/views/i18n.py
View
1  AUTHORS
@@ -257,6 +257,7 @@ answer newbie questions, and generally made Django that much better:
thebjorn <bp@datakortet.no>
Zach Thompson <zthompson47@gmail.com>
tibimicu@gmax.net
+ tobias@neuyork.de
Tom Tobin
Joe Topjian <http://joe.terrarum.net/geek/code/python/django/>
torne-django@wolfpuppy.org.uk
View
4 django/views/i18n.py
@@ -69,9 +69,9 @@ def set_language(request):
InterPolate = r"""
function interpolate(fmt, obj, named) {
if (named) {
- return fmt.replace(/%\(\w+\)s/, function(match){return String(obj[match.slice(2,-2)])});
+ return fmt.replace(/%\(\w+\)s/g, function(match){return String(obj[match.slice(2,-2)])});
} else {
- return fmt.replace(/%s/, function(match){return String(obj.shift())});
+ return fmt.replace(/%s/g, function(match){return String(obj.shift())});
}
}
"""
Please sign in to comment.
Something went wrong with that request. Please try again.