summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-08-11 10:51:02 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2007-08-11 10:51:02 +0000
commit537b16ca97fd3a433a3ce514d8a5659688431cd4 (patch)
tree95dafc7375d2cbeee4161c97a5240f469af95755 /django
parent9d7dc0c4bfdc7f1638acd68744a2883dd3d3d73d (diff)
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
Diffstat (limited to 'django')
-rw-r--r--django/views/i18n.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/views/i18n.py b/django/views/i18n.py
index 0fec6b6c6f..320caf37d7 100644
--- a/django/views/i18n.py
+++ b/django/views/i18n.py
@@ -69,9 +69,9 @@ function pluralidx(count) { return (count == 1) ? 0 : 1; }
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())});
}
}
"""