HarshvardhanCn01 commited on
Commit
1becaa9
·
verified ·
1 Parent(s): b6cffd9

Update i18n.py

Browse files
Files changed (1) hide show
  1. i18n.py +5 -1
i18n.py CHANGED
@@ -1,8 +1,12 @@
1
  import json
2
 
 
 
 
3
  def load_language_list(language):
4
  try:
5
- with open(f"./i18n/locale/{language}.json", "r", encoding="utf-8") as f:
 
6
  return json.load(f)
7
  except FileNotFoundError:
8
  raise FileNotFoundError(
 
1
  import json
2
 
3
+ from pathlib import Path
4
+
5
+ _CURR_DIR = Path(__file__).parent
6
  def load_language_list(language):
7
  try:
8
+ path = _CURR_DIR / "i18n" / "locale" / f"{language}.json"
9
+ with open(, "r", encoding="utf-8") as f:
10
  return json.load(f)
11
  except FileNotFoundError:
12
  raise FileNotFoundError(