chore: update localization regex script to support getString and i18n.stripped uses

pull/3206/head
Ryan Miller 8 months ago
parent 718b814902
commit e1f5c3ce23

@ -9,8 +9,10 @@ def localization_regex(string):
res_8n = r"window\.i18n\(\s*'{}'(?:,\s*(?:[^\)]+?))?\s*\)".format(e_str)
res_comp = r'<I18n\s+[^>]*?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,
)

Loading…
Cancel
Save