injectorHub/ui/lang.py

16 lines
280 B
Python
Raw Normal View History

2024-05-03 09:08:46 +08:00
from logger.logger import *
import tomllib
l_obj = {}
def load_lang(lang: str):
info(f"[lang]load lang: {lang}")
global l_obj
with open("lang/"+lang+".toml", "rb") as file:
l_obj = tomllib.load(file)
def l(strs):
return l_obj.get(strs, f"__{strs}__")