Django

Code

Changeset 5849

Show
Ignore:
Timestamp:
08/11/07 05:51:02 (1 year ago)
Author:
mtredinnick
Message:

Fixed #4414 -- Fixed Javascript message translation to also work when there is more than one format marker in a string. Thanks, tobias@neuyork.de.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/AUTHORS

    r5848 r5849  
    258258    Zach Thompson <zthompson47@gmail.com> 
    259259    tibimicu@gmax.net 
     260    tobias@neuyork.de 
    260261    Tom Tobin 
    261262    Joe Topjian <http://joe.terrarum.net/geek/code/python/django/> 
  • django/trunk/django/views/i18n.py

    r5091 r5849  
    7070function interpolate(fmt, obj, named) { 
    7171  if (named) { 
    72     return fmt.replace(/%\(\w+\)s/, function(match){return String(obj[match.slice(2,-2)])}); 
     72    return fmt.replace(/%\(\w+\)s/g, function(match){return String(obj[match.slice(2,-2)])}); 
    7373  } else { 
    74     return fmt.replace(/%s/, function(match){return String(obj.shift())}); 
     74    return fmt.replace(/%s/g, function(match){return String(obj.shift())}); 
    7575  } 
    7676}