_msg_hold. Internal helper function. This docstring was expanded to make future maintenance easier. Args: m: Parameter. Returns: Varies.
(m)
| 2994 | return ">" + out + "<" |
| 2995 | |
| 2996 | return _TEXT_NODE_RE.sub(repl, body) |
| 2997 | |
| 2998 | # --- Attribute translation (title/placeholder/aria-label) --------------------- |
| 2999 | # The HTML text-node translator does not touch attributes. That caused mixed EN/EL |
| 3000 | # tooltips/placeholders (e.g., delivery ticks) in Greek mode. |
| 3001 | _ATTR_RE = re.compile(r'\b(title|aria-label|placeholder|data-bs-original-title|data-bs-title|data-open|data-closed|alt)="([^"]*)"') |
| 3002 | |
| 3003 | def _translate_common_attributes(body: str, lang: str) -> str: |
| 3004 | """Translate common UI attributes in rendered HTML (best-effort). |
| 3005 | |
| 3006 | We only touch a small, safe set of attributes: |
| 3007 | - title |
| 3008 | - aria-label |
| 3009 | - placeholder |
| 3010 | |
| 3011 | We intentionally skip values that contain 'ButSystem' to keep |
| 3012 | the brand label unchanged. |
| 3013 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected