Django

Code

Show
Ignore:
Timestamp:
04/07/08 15:29:36 (9 months ago)
Author:
jbronn
Message:

gis: Merged revisions 7355-7403 via svnmerge from trunk.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/gis

    • Property svnmerge-integrated changed from /django/trunk:1-7353 to /django/trunk:1-7404
  • django/branches/gis/django/views/i18n.py

    r7279 r7405  
    8383""" 
    8484 
     85PluralIdx = r""" 
     86function pluralidx(n) { 
     87  var v=%s; 
     88  if (typeof(v) == 'boolean') { 
     89    return v ? 1 : 0; 
     90  } else { 
     91    return v; 
     92  } 
     93} 
     94""" 
     95 
    8596def null_javascript_catalog(request, domain=None, packages=None): 
    8697    """ 
     
    155166        # Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2; 
    156167        plural = [el.strip() for el in plural.split(';') if el.strip().startswith('plural=')][0].split('=',1)[1] 
    157         src.append('function pluralidx(n) {\n    return %s;\n}\n' % plural) 
     168        src.append(PluralIdx % plural) 
    158169    else: 
    159170        src.append(SimplePlural)