diff --git a/script.py b/script.py index ae3d6c12..72e11094 100755 --- a/script.py +++ b/script.py @@ -246,13 +246,19 @@ def process_line( # Highlight localized strings line = re.sub( - r'([a-z0-9_]+loc\((?:\d+, )?)"((?:[^"\\]|\\.)+)(", (?:.+, )?"[a-z0-9_-]+")\)', # noqa: E501 + r'([a-z0-9_]+loc\((?:\d+, )?)"((?:[^"\\]|\\.)+)(", "[a-z0-9_-]+")\)', lambda matches: matches[1] + highlight_text(matches) + ')', line, flags=re.IGNORECASE, ) line = re.sub( - r'(scr_(?:84_get_lang_string(?:_ch1)?|gettext)\(")([a-z0-9_-]+)("\))', # noqa: E501 + r'([a-z0-9_]+subloc\((?:\d+, )?)"((?:[^"\\]|\\.)+)(", (?:.+, )?"[a-z0-9_-]+")\)', # noqa: E501 + lambda matches: matches[1] + highlight_text(matches) + ')', + line, + flags=re.IGNORECASE, + ) + line = re.sub( + r'(scr_(?:84_get_lang_string(?:_ch1)?|gettext)\(")([a-z0-9_-]+)("\))', lambda matches: highlight_text_ch1(matches, data), line, flags=re.IGNORECASE,