Changeset 6565
- Timestamp:
- 10/20/07 07:29:56 (1 year ago)
- Files:
-
- django/trunk/django/templatetags/i18n.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/templatetags/i18n.py
r6399 r6565 1 import re 2 1 3 from django.template import Node, Variable 2 4 from django.template import TemplateSyntaxError, TokenParser, Library … … 69 71 context[self.countervar] = count 70 72 plural = self.render_token_list(self.plural) 71 result = translation.ungettext(singular, plural, count) % context73 result = translation.ungettext(singular, plural, count) 72 74 else: 73 result = translation.ugettext(singular) % context 75 result = translation.ugettext(singular) 76 # Escape all isolated '%' before substituting in the context. 77 result = re.sub('%(?!\()', '%%', result) % context 74 78 context.pop() 75 79 return result
