MCPcopy Create free account
hub / github.com/dedsec1121fk/DedSec / toggle_language

Function toggle_language

Scripts/ButSystem.py:2950–2961  ·  view source on GitHub ↗

toggle_language. Route handler or application helper. This docstring was expanded to make future maintenance easier. Returns: Varies.

()

Source from the content-addressed store, hash-verified

2948TRANSLATIONS_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
2955def _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

Callers

nothing calls this directly

Calls 2

get_langFunction · 0.70
is_logged_inFunction · 0.70

Tested by

no test coverage detected