Ticket #4713: __init__.2.diff
File __init__.2.diff, 1.2 KB (added by , 17 years ago) |
---|
-
django/template/__init__.py
89 89 re.escape(VARIABLE_TAG_START), re.escape(VARIABLE_TAG_END), 90 90 re.escape(COMMENT_TAG_START), re.escape(COMMENT_TAG_END))) 91 91 92 # matches if the string is marked for translation 93 trans_re = re.compile(r'_\((\'|").*?(\'|")\)') 94 92 95 # global dictionary of libraries that have been loaded using get_library 93 96 libraries = {} 94 97 # global list of libraries to load by default for a new parser … … 691 694 # we're also dealing with a literal. 692 695 if var[0] in "\"'" and var[0] == var[-1]: 693 696 self.literal = var[1:-1] 694 697 # If it isn't a literal, check if it's marked for translation. 698 elif trans_re.match(var): 699 self.literal = _(var[3:-2]) 695 700 else: 696 701 # Otherwise we'll set self.lookups so that resolve() knows we're 697 702 # dealing with a bonafide variable