Closed rangermeier closed 2 years ago
The included makemessages management command shows errors when translateable strings contain escaped characters.
E.g. a template like example.html
<a href="#" title=" {{ _('Don\t click "Delete" if unsure.')}}">{{ _('Delete') }}</a>
Gives this warning when ./manage.py makemessage is run:
./manage.py makemessage
./templates/example.html.py:1: warning: unterminated string
This can be fixed by adding a negative lookbehind to the regex:
trans_real.constant_re = re.compile(r"""_\(((?:".*?(?<!\\)")|(?:'.*?(?<!\\)')).*\)""")
Pushed fix to master, please, test it.
closing this issue as it looks like the fix for it has since been changed more recently anyway.
The included makemessages management command shows errors when translateable strings contain escaped characters.
E.g. a template like example.html
Gives this warning when
./manage.py makemessage
is run:This can be fixed by adding a negative lookbehind to the regex: