makemessages: Fix handling of handlebars whitespace control.

Our logic for extracting strings from templates did not properly
handle the syntax for code containing whitespace control characters,
resulting in a couple strings from subscribe_to_more_streams.hbs not
being processed.
This commit is contained in:
Tim Abbott
2023-09-08 08:35:35 -07:00
parent 7d683018bd
commit bcff5580d1

View File

@@ -52,9 +52,9 @@ strip_whitespace_left = re.compile(
)
regexes = [
r"{{#tr}}([\s\S]*?)(?:{{/tr}}|{{#\*inline )", # '.' doesn't match '\n' by default
r'{{\s*t "([\s\S]*?)"\W*}}',
r"{{\s*t '([\s\S]*?)'\W*}}",
r"{{~?#tr}}([\s\S]*?)(?:~?{{/tr}}|{{#\*inline )", # '.' doesn't match '\n' by default
r'{{~?\s*t "([\s\S]*?)"\W*~?}}',
r"{{~?\s*t '([\s\S]*?)'\W*~?}}",
r'\(t "([\s\S]*?)"\)',
r'=\(t "([\s\S]*?)"\)(?=[^{]*}})',
r"=\(t '([\s\S]*?)'\)(?=[^{]*}})",