summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorJulien Phalip <jphalip@gmail.com>2012-09-27 20:34:45 -0700
committerJulien Phalip <jphalip@gmail.com>2012-10-13 10:51:53 -0700
commitcc0478606a1d3dd804bc005a78e616550d3d0d41 (patch)
tree3d64b632127f14d7ff6beafa10df89b40d1feb06 /django
parent4cdc416d039c7cfc04aa7bc156dd5a1c737375ed (diff)
[1.4.x] Fixed #18881 -- Made the context option in {% trans %} and {% blocktrans %} accept literals wrapped in single quotes. Thanks to lanyjie for the report.
Diffstat (limited to 'django')
-rw-r--r--django/utils/translation/trans_real.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py
index 82072b1397..427b3f6a83 100644
--- a/django/utils/translation/trans_real.py
+++ b/django/utils/translation/trans_real.py
@@ -438,8 +438,8 @@ def blankout(src, char):
return dot_re.sub(char, src)
context_re = re.compile(r"""^\s+.*context\s+((?:"[^"]*?")|(?:'[^']*?'))\s*""")
-inline_re = re.compile(r"""^\s*trans\s+((?:"[^"]*?")|(?:'[^']*?'))(\s+.*context\s+(?:"[^"]*?")|(?:'[^']*?'))?\s*""")
-block_re = re.compile(r"""^\s*blocktrans(\s+.*context\s+(?:"[^"]*?")|(?:'[^']*?'))?(?:\s+|$)""")
+inline_re = re.compile(r"""^\s*trans\s+((?:"[^"]*?")|(?:'[^']*?'))(\s+.*context\s+((?:"[^"]*?")|(?:'[^']*?')))?\s*""")
+block_re = re.compile(r"""^\s*blocktrans(\s+.*context\s+((?:"[^"]*?")|(?:'[^']*?')))?(?:\s+|$)""")
endblock_re = re.compile(r"""^\s*endblocktrans$""")
plural_re = re.compile(r"""^\s*plural$""")
constant_re = re.compile(r"""_\(((?:".*?")|(?:'.*?'))\)""")