Update regular expressions to support PEP 3101

This commit is contained in:
Adam J. Forster 2015-08-13 11:37:23 +01:00
parent 9713471de1
commit 155ed011a7
2 changed files with 2 additions and 2 deletions

View file

@ -89,7 +89,7 @@ google.setOnLoadCallback(function() {
$('.translation textarea').blur(function() {
if($(this).val()) {
$('.alert', $(this).parents('tr')).remove();
var RX = /%(?:\([^\s\)]*\))?[sdf]/g,
var RX = /%(?:\([^\s\)]*\))?[sdf]|\{[\w\d_]+?\}/g,
origs=$('.original', $(this).parents('tr')).html().match(RX),
trads=$(this).val().match(RX),
error = $('<span class="alert">Unmatched variables</span>');

View file

@ -7,7 +7,7 @@ import six
register = template.Library()
rx = re.compile(r'(%(\([^\s\)]*\))?[sd])')
rx = re.compile(r'(%(\([^\s\)]*\))?[sd]|\{[\w\d_]+?\})')
def format_message(message):