toggle_language. Route handler or application helper. This docstring was expanded to make future maintenance easier. Returns: Varies.
()
| 2948 | TRANSLATIONS_EN.setdefault("Θέμα", "Subject") |
| 2949 | |
| 2950 | # Compile once after all TRANSLATIONS_EL updates are done. |
| 2951 | _compile_safe_phrase_maps() |
| 2952 | |
| 2953 | _TEXT_NODE_RE = re.compile(r">([^<>]+)<") |
| 2954 | |
| 2955 | def _translate_text_nodes(body: str, lang: str) -> str: |
| 2956 | """Translate only visible text nodes between > and < (best-effort). |
| 2957 | |
| 2958 | Strategy per text node: |
| 2959 | 1) Apply explicit phrase replacements (TRANSLATIONS_EL / TRANSLATIONS_EN) sorted by length. |
| 2960 | 2) Apply fallback word-level mapping (_WORD_MAP_EL / _WORD_MAP_EN). |
| 2961 | """ |
| 2962 | def repl(m): |
| 2963 | """repl. |
| 2964 |
nothing calls this directly
no test coverage detected