diff options
| author | Julien Phalip <jphalip@gmail.com> | 2012-09-27 20:34:45 -0700 |
|---|---|---|
| committer | Julien Phalip <jphalip@gmail.com> | 2012-09-27 20:34:45 -0700 |
| commit | b8244c654c85034bd4209a93a7802eb306c32e2b (patch) | |
| tree | 1c9739c946396695847125254713561069cba868 /django | |
| parent | 751a7d0c32746dc6774f1b561db523b25365148a (diff) | |
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.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py index 9fd33a7ea8..6911c2c723 100644 --- a/django/utils/translation/trans_real.py +++ b/django/utils/translation/trans_real.py @@ -437,8 +437,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"""_\(((?:".*?")|(?:'.*?'))\)""") |
