revert: "fix: improve translation pattern" (#12205)

This commit is contained in:
Suraj Shetty 2021-01-13 20:46:27 +05:30 committed by GitHub
parent 5f2dda205c
commit 00896f36fe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,7 @@ import re
import sys
errors_encounter = 0
pattern = re.compile(r"_{1,2}\(\s*([\"'`])(?P<message>((?!\1).)+?)\1(\s*,\s*context\s*=\s*([\"'])(?P<py_context>((?!\5).)+?)\5)?(\s*,\s*(\[[\s\S]*\])?(null)?(\s*,\s*([\"'`])(?P<js_context>((?!\12).)+?)\12)?)?\s*\)") # noqa: E501
pattern = re.compile(r"_\(([\"']{,3})(?P<message>((?!\1).)*)\1(\s*,\s*context\s*=\s*([\"'])(?P<py_context>((?!\5).)*)\5)*(\s*,\s*(.)*?\s*(,\s*([\"'])(?P<js_context>((?!\11).)*)\11)*)*\)")
words_pattern = re.compile(r"_{1,2}\([\"'`]{1,3}.*?[a-zA-Z]")
start_pattern = re.compile(r"_{1,2}\([f\"'`]{1,3}")
f_string_pattern = re.compile(r"_\(f[\"']")