From 5717876b22aa8d85033838c317430e681451b738 Mon Sep 17 00:00:00 2001 From: Ryan Miller Date: Tue, 27 Aug 2024 11:55:38 +1000 Subject: [PATCH] chore: update python strings regex --- tools/localization/regex.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/localization/regex.py b/tools/localization/regex.py index 0f55a11a7..77ac55a97 100644 --- a/tools/localization/regex.py +++ b/tools/localization/regex.py @@ -10,9 +10,12 @@ def localization_regex(string): res_comp = r']*?token=["\']{}["\'][^>]*?>'.format(e_str) res_token = r'token=["\']{}["\']'.format(e_str) res_8n_stripped = r"window\.i18n\.stripped\(\s*'{}'(?:,\s*(?:[^\)]+?))?\s*\)".format(e_str) + res_8n_inEnglish = r"window\.i18n\.inEnglish\(\s*'{}'(?:,\s*(?:[^\)]+?))?\s*\)".format(e_str) + res_8n_raw = r"window\.i18n\.getRawMessage\(\s*'{}'(?:,\s*(?:[^\)]+?))?\s*\)".format(e_str) res_get_string = r"getString\(\s*'{}'(?:,\s*(?:[^\)]+?))?\s*\)".format(e_str) + res_i18n_args = r"{\s*token: '" + e_str + r"'(?:,\s*(?:[^\)]+?))?\s*}" return re.compile( - f"{rex_b}|{rex_l}|{res_8n}|{res_comp}|{res_token}|{res_get_string}|{res_8n_stripped}", + f"{rex_b}|{rex_l}|{res_8n}|{res_comp}|{res_token}|{res_get_string}|{res_8n_stripped}|{res_8n_inEnglish}|{res_8n_raw}|{res_i18n_args}", re.DOTALL, )