Skip to content

Commit b1607f9

Browse files
committed
TASK: Optimize translation.ini path
1 parent aa332a1 commit b1607f9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lang/language.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
import os
66

77
__author__ = 'Rico'
8+
dir_path = os.path.dirname(os.path.abspath(__file__))
9+
file_path = os.path.join(dir_path, "translations.ini")
810

9-
path = os.path.dirname(os.path.abspath(__file__))
1011
translations = configparser.ConfigParser()
11-
translations.read_file(codecs.open(path + "/translations.ini", encoding="UTF-8"))
12+
translations.read_file(codecs.open(file_path, encoding="UTF-8"))
1213

1314

1415
# translate returns the translation for a specific string

0 commit comments

Comments
 (0)