Allow German/Spanish CTA phrasing in audit
This commit is contained in:
@@ -30,6 +30,7 @@ CTA_RULES = {
|
||||
r"^Send ",
|
||||
),
|
||||
"de": (
|
||||
r"^Beratung",
|
||||
r"^Plan",
|
||||
r"^Mehr",
|
||||
r"^Support",
|
||||
@@ -84,6 +85,7 @@ CTA_RULES = {
|
||||
r"^Contactar",
|
||||
r"^Planificar",
|
||||
r"^Programe",
|
||||
r"^Programar",
|
||||
r"^Concertar",
|
||||
r"^Enviar",
|
||||
r"^Mostrar",
|
||||
@@ -141,6 +143,8 @@ def validate_cta(locale_code: str, field_path: str, normalized: str):
|
||||
last_segment = field_path.split(".")[-1]
|
||||
if last_segment not in CTA_FIELDS:
|
||||
return []
|
||||
if any(re.search(pattern, normalized) for pattern in CTA_RULES.get(locale_code, ())):
|
||||
if any(
|
||||
re.search(pattern, normalized) for pattern in CTA_RULES.get(locale_code, ())
|
||||
):
|
||||
return []
|
||||
return [make_issue("cta_language_mismatch", field_path, normalized)]
|
||||
|
||||
Reference in New Issue
Block a user