From e1f5c3ce239426214c67244ee15045724f8b84fc Mon Sep 17 00:00:00 2001 From: Ryan Miller Date: Tue, 20 Aug 2024 09:58:41 +1000 Subject: [PATCH] chore: update localization regex script to support getString and i18n.stripped uses --- tools/localization/regex.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/localization/regex.py b/tools/localization/regex.py index 6c4d44d2b..0f55a11a7 100644 --- a/tools/localization/regex.py +++ b/tools/localization/regex.py @@ -9,8 +9,10 @@ def localization_regex(string): res_8n = r"window\.i18n\(\s*'{}'(?:,\s*(?:[^\)]+?))?\s*\)".format(e_str) 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_get_string = r"getString\(\s*'{}'(?:,\s*(?:[^\)]+?))?\s*\)".format(e_str) return re.compile( - f"{rex_b}|{rex_l}|{res_8n}|{res_comp}|{res_token}", + f"{rex_b}|{rex_l}|{res_8n}|{res_comp}|{res_token}|{res_get_string}|{res_8n_stripped}", re.DOTALL, )