MCPcopy Index your code
hub / github.com/dataease/SQLBot / load_translations

Method load_translations

backend/common/utils/locale.py:14–21  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

12 self.load_translations()
13
14 def load_translations(self):
15 if not self.locale_dir.exists():
16 self.locale_dir.mkdir()
17 return
18
19 for lang_file in self.locale_dir.glob("*.json"):
20 with open(lang_file, 'r', encoding='utf-8') as f:
21 self.translations[lang_file.stem.lower()] = json.load(f)
22
23 def get_language(self, request: Request = None, lang: str = None) -> str:
24 primary_lang: str | None = None

Callers 1

__init__Method · 0.95

Calls 3

openFunction · 0.85
existsMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected