Ticket #14586: interpolate_mod.diff

File interpolate_mod.diff, 583 bytes (added by aminland, 5 years ago)
  • django/views/i18n.py

    diff --git a/django/views/i18n.py b/django/views/i18n.py
    index 2078649..3cd4a84 100644
    a b function pluralidx(count) { return (count == 1) ? 0 : 1; } 
    123123"""
    124124
    125125InterPolate = r"""
    126 function interpolate(fmt, obj, named) {
    127   if (named) {
     126function interpolate(fmt, obj) {
     127  if (obj.constructor.toString().indexOf('Object') != -1) {
    128128    return fmt.replace(/%\(\w+\)s/g, function(match){return String(obj[match.slice(2,-2)])});
    129129  } else {
    130130    return fmt.replace(/%s/g, function(match){return String(obj.shift())});
Back to Top