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

Function get_lang

Scripts/ButSystem.py:2902–2913  ·  view source on GitHub ↗

get_lang. Internal helper function. This docstring was added automatically to improve maintainability. Returns: Varies.

()

Source from the content-addressed store, hash-verified

2900_EN_PHRASE_KEYS: List[str] = []
2901_EL_WORD_RE = None
2902_EN_WORD_RE = None
2903
2904def _compile_safe_phrase_maps():
2905 """Compile safe replacement helpers to avoid substring misspellings (e.g., Add -> Address)."""
2906 global _EL_PHRASE_KEYS, _EN_PHRASE_KEYS, _EL_WORD_RE, _EN_WORD_RE
2907
2908 # English -> Greek
2909 el_word_keys = [k for k in TRANSLATIONS_EL.keys() if _SIMPLE_WORD_EN_RE.fullmatch(k or "")]
2910 el_phrase_keys = [k for k in TRANSLATIONS_EL.keys() if k not in el_word_keys]
2911 _EL_PHRASE_KEYS = sorted(el_phrase_keys, key=len, reverse=True)
2912 if el_word_keys:
2913 _EL_WORD_RE = re.compile(r"\b(" + "|".join(sorted(map(re.escape, el_word_keys), key=len, reverse=True)) + r")\b")
2914 else:
2915 _EL_WORD_RE = None
2916

Callers 7

_set_lang_on_gFunction · 0.70
toggle_languageFunction · 0.70
_Function · 0.70
_translate_html_responseFunction · 0.70
newsFunction · 0.70
api_newsFunction · 0.70
_bounty_currency_symbolFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected