Ticket #4713: __init__.diff

File __init__.diff, 865 bytes (added by Indy, 17 years ago)

Simple patch

  • django/template/__init__.py

     
    9696# matches if the string is valid number
    9797number_re = re.compile(r'[-+]?(\d+|\d*\.\d+)$')
    9898
     99# matches if the string is marked for translation
     100trans_re = re.compile(r'_\((\'|").*?(\'|")\)')
     101
    99102# global dictionary of libraries that have been loaded using get_library
    100103libraries = {}
    101104# global list of libraries to load by default for a new parser
     
    661664    if number_re.match(path):
    662665        number_type = '.' in path and float or int
    663666        current = number_type(path)
     667    elif trans_re.match(path):
     668        current = _(path[3:-2])
    664669    elif path[0] in ('"', "'") and path[0] == path[-1]:
    665670        current = path[1:-1]
    666671    else:
Back to Top