Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyEye-FAST committed May 7, 2024
1 parent 760d84a commit 7a50680
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions init.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
IGNORE_SUPPLEMENTS = True

# 读取语言文件
data = {}
data: dict[str, dict[str, str]] = {}
for lang_name in language_list:
with open(LANG_DIR_VALID / f"{lang_name}.json", "r", encoding="utf-8") as f:
data[lang_name] = json.load(f)
Expand All @@ -25,7 +25,7 @@

def get_translation(query_str: str) -> dict[str, str]:
"""在语言文件中匹配含有输入内容的源字符串"""
translation = {}
translation: dict[str, str] = {}
for k, v in data["en_us"].items():
if query_str.lower() in v.lower():
element = {lang: content.get(k, "?") for lang, content in data.items()}
Expand Down

0 comments on commit 7a50680

Please sign in to comment.