vnpy/vn.trader/gateway/ctpGateway/language/__init__.py
2017-04-07 23:00:25 +08:00

24 lines
524 B
Python

# encoding: UTF-8
import json
import os
import traceback
# 默认设置
from Chinese import text
# 获取目录上级路径
path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..'))
SETTING_FILENAME = 'VT_setting.json'
SETTING_FILENAME = os.path.join(path, SETTING_FILENAME)
# 打开配置文件,读取语言配置
try:
f = file(SETTING_FILENAME)
setting = json.load(f)
if setting['language'] == 'English':
from English import text
f.close()
except:
traceback.print_exc()