forked from detexploit/DetExploit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
langpack.py
33 lines (26 loc) · 935 Bytes
/
langpack.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
###########################################################
# langpack.py
# Script file related to language package system of DetExploit.
# DetExploit (https://github.com/moppoi5168/DetExploit)
# Licensed by GPL License
###########################################################
import configparser
def load_langpack(cp):
langdata = {}
lang = cp.get('general', 'lang')
if lang == 'en':
lf_path = 'resources/langpack/en-langpack.detexploit'
elif lang == 'ja':
lf_path = 'resources/langpack/ja-langpack.detexploit'
else:
print('ERROR: Language Package Load Error, Check config.ini!!!')
exit(1)
with open(lf_path, errors='ignore', encoding='UTF-8') as lf:
ld = lf.readlines()
for line in ld:
ldata = line.split(' : ')
try:
langdata[ldata[0]] = ldata[1][:-1]
except IndexError:
continue
return langdata