vnpy/vn.trader/language/__init__.py

24 lines
505 B
Python
Raw Normal View History

2017-04-28 14:10:07 +00:00
# encoding: UTF-8
import json
import os
2017-05-10 11:30:36 +00:00
2017-04-28 14:10:07 +00:00
# 默认设置
from chinese import text, constant
# 获取目录上级路径
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, constant
f.close()
except:
pass