vnpy/vn.trader/language/__init__.py

23 lines
504 B
Python
Raw Normal View History

2017-03-19 08:10:05 +00:00
# encoding: UTF-8
import json
import os
# 默认设置
from chinese import text, constant
2017-03-19 08:10:05 +00:00
# 获取目录上级路径
path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
SETTING_FILENAME = 'VT_setting.json'
2017-03-19 08:10:05 +00:00
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, constant
2017-03-19 08:10:05 +00:00
f.close()
except:
pass