Code

Ticket #18881: 18881.trans-context-single-quotes-CODE-ONLY.diff

File 18881.trans-context-single-quotes-CODE-ONLY.diff, 968 bytes (added by julien, 22 months ago)
Line 
1diff --git a/django/utils/translation/trans_real.py b/django/utils/translation/trans_real.py
2index 9fd33a7..6911c2c 100644
3--- a/django/utils/translation/trans_real.py
4+++ b/django/utils/translation/trans_real.py
5@@ -437,8 +437,8 @@ def blankout(src, char):
6     return dot_re.sub(char, src)
7 
8 context_re = re.compile(r"""^\s+.*context\s+((?:"[^"]*?")|(?:'[^']*?'))\s*""")
9-inline_re = re.compile(r"""^\s*trans\s+((?:"[^"]*?")|(?:'[^']*?'))(\s+.*context\s+(?:"[^"]*?")|(?:'[^']*?'))?\s*""")
10-block_re = re.compile(r"""^\s*blocktrans(\s+.*context\s+(?:"[^"]*?")|(?:'[^']*?'))?(?:\s+|$)""")
11+inline_re = re.compile(r"""^\s*trans\s+((?:"[^"]*?")|(?:'[^']*?'))(\s+.*context\s+((?:"[^"]*?")|(?:'[^']*?')))?\s*""")
12+block_re = re.compile(r"""^\s*blocktrans(\s+.*context\s+((?:"[^"]*?")|(?:'[^']*?')))?(?:\s+|$)""")
13 endblock_re = re.compile(r"""^\s*endblocktrans$""")
14 plural_re = re.compile(r"""^\s*plural$""")
15 constant_re = re.compile(r"""_\(((?:".*?")|(?:'.*?'))\)""")