2017-04-07 15:00:25 +00:00
|
|
|
# encoding: UTF-8
|
|
|
|
|
|
|
|
import json
|
|
|
|
import os
|
|
|
|
import traceback
|
|
|
|
|
|
|
|
# 默认设置
|
2017-04-10 13:40:18 +00:00
|
|
|
from chinese import text
|
2017-04-07 15:00:25 +00:00
|
|
|
|
|
|
|
# 获取目录上级路径
|
2017-04-10 13:40:18 +00:00
|
|
|
path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..'))
|
2017-04-07 15:00:25 +00:00
|
|
|
SETTING_FILENAME = 'VT_setting.json'
|
|
|
|
SETTING_FILENAME = os.path.join(path, SETTING_FILENAME)
|
|
|
|
|
|
|
|
# 打开配置文件,读取语言配置
|
|
|
|
try:
|
|
|
|
f = file(SETTING_FILENAME)
|
|
|
|
setting = json.load(f)
|
2017-04-10 13:40:18 +00:00
|
|
|
if setting['language'] == 'english':
|
|
|
|
from english import text
|
2017-04-07 15:00:25 +00:00
|
|
|
f.close()
|
|
|
|
except:
|
|
|
|
traceback.print_exc()
|