Skip to content

Commit

Permalink
[Mod] translation ui language to English
Browse files Browse the repository at this point in the history
  • Loading branch information
vnpy committed Dec 20, 2023
1 parent 4f9eba7 commit 60fbeab
Show file tree
Hide file tree
Showing 3 changed files with 136 additions and 136 deletions.
46 changes: 23 additions & 23 deletions vnpy/trader/ui/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self, main_engine: MainEngine, event_engine: EventEngine) -> None:
self.main_engine: MainEngine = main_engine
self.event_engine: EventEngine = event_engine

self.window_title: str = f"VeighNa Trader 社区版 - {vnpy.__version__} [{TRADER_DIR}]"
self.window_title: str = f"VeighNa Trader Crypto - {vnpy.__version__} [{TRADER_DIR}]"

self.widgets: Dict[str, QtWidgets.QWidget] = {}
self.monitors: Dict[str, BaseMonitor] = {}
Expand All @@ -61,28 +61,28 @@ def init_ui(self) -> None:
def init_dock(self) -> None:
""""""
self.trading_widget, trading_dock = self.create_dock(
TradingWidget, "交易", QtCore.Qt.LeftDockWidgetArea
TradingWidget, "Trading", QtCore.Qt.LeftDockWidgetArea
)
tick_widget, tick_dock = self.create_dock(
TickMonitor, "行情", QtCore.Qt.RightDockWidgetArea
TickMonitor, "Market", QtCore.Qt.RightDockWidgetArea
)
order_widget, order_dock = self.create_dock(
OrderMonitor, "委托", QtCore.Qt.RightDockWidgetArea
OrderMonitor, "Order", QtCore.Qt.RightDockWidgetArea
)
active_widget, active_dock = self.create_dock(
ActiveOrderMonitor, "活动", QtCore.Qt.RightDockWidgetArea
ActiveOrderMonitor, "Active", QtCore.Qt.RightDockWidgetArea
)
trade_widget, trade_dock = self.create_dock(
TradeMonitor, "成交", QtCore.Qt.RightDockWidgetArea
TradeMonitor, "Trade", QtCore.Qt.RightDockWidgetArea
)
log_widget, log_dock = self.create_dock(
LogMonitor, "日志", QtCore.Qt.BottomDockWidgetArea
LogMonitor, "Log", QtCore.Qt.BottomDockWidgetArea
)
account_widget, account_dock = self.create_dock(
AccountMonitor, "资金", QtCore.Qt.BottomDockWidgetArea
AccountMonitor, "Account", QtCore.Qt.BottomDockWidgetArea
)
position_widget, position_dock = self.create_dock(
PositionMonitor, "持仓", QtCore.Qt.BottomDockWidgetArea
PositionMonitor, "Position", QtCore.Qt.BottomDockWidgetArea
)

self.tabifyDockWidget(active_dock, order_dock)
Expand All @@ -98,14 +98,14 @@ def init_menu(self) -> None:
bar.setNativeMenuBar(False) # for mac and linux

# System menu
sys_menu: QtWidgets.QMenu = bar.addMenu("系统")
sys_menu: QtWidgets.QMenu = bar.addMenu("System")

gateway_names: list = self.main_engine.get_all_gateway_names()
for name in gateway_names:
func: Callable = partial(self.connect, name)
self.add_action(
sys_menu,
f"连接{name}",
f"Connect {name}",
get_icon_path(__file__, "connect.ico"),
func
)
Expand All @@ -114,13 +114,13 @@ def init_menu(self) -> None:

self.add_action(
sys_menu,
"退出",
"Exit",
get_icon_path(__file__, "exit.ico"),
self.close
)

# App menu
app_menu: QtWidgets.QMenu = bar.addMenu("功能")
app_menu: QtWidgets.QMenu = bar.addMenu("App")

all_apps: List[BaseApp] = self.main_engine.get_all_apps()
for app in all_apps:
Expand All @@ -132,54 +132,54 @@ def init_menu(self) -> None:
self.add_action(app_menu, app.display_name, app.icon_name, func, True)

# Global setting editor
action: QtGui.QAction = QtWidgets.QAction("配置", self)
action: QtGui.QAction = QtWidgets.QAction("Setting", self)
action.triggered.connect(self.edit_global_setting)
bar.addAction(action)

# Help menu
help_menu: QtWidgets.QMenu = bar.addMenu("帮助")
help_menu: QtWidgets.QMenu = bar.addMenu("Help")

self.add_action(
help_menu,
"查询合约",
"Query Contract",
get_icon_path(__file__, "contract.ico"),
partial(self.open_widget, ContractManager, "contract"),
True
)

self.add_action(
help_menu,
"还原窗口",
"Restore Window",
get_icon_path(__file__, "restore.ico"),
self.restore_window_setting
)

self.add_action(
help_menu,
"测试邮件",
"Test Email",
get_icon_path(__file__, "email.ico"),
self.send_test_email
)

self.add_action(
help_menu,
"社区论坛",
"Community Forum",
get_icon_path(__file__, "forum.ico"),
self.open_forum,
True
)

self.add_action(
help_menu,
"关于",
"About",
get_icon_path(__file__, "about.ico"),
partial(self.open_widget, AboutDialog, "about"),
)

def init_toolbar(self) -> None:
""""""
self.toolbar: QtWidgets.QToolBar = QtWidgets.QToolBar(self)
self.toolbar.setObjectName("工具栏")
self.toolbar.setObjectName("Toolbar")
self.toolbar.setFloatable(False)
self.toolbar.setMovable(False)

Expand Down Expand Up @@ -246,8 +246,8 @@ def closeEvent(self, event: QtGui.QCloseEvent) -> None:
"""
reply = QtWidgets.QMessageBox.question(
self,
"退出",
"确认退出?",
"Exit",
"Confirm Exit?",
QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No,
QtWidgets.QMessageBox.No,
)
Expand Down
8 changes: 4 additions & 4 deletions vnpy/trader/ui/qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,19 @@ def __init__(self, parent: QtWidgets.QWidget = None) -> None:

def init_ui(self) -> None:
""""""
self.setWindowTitle("触发异常")
self.setWindowTitle("Exception")
self.setFixedSize(600, 600)

self.msg_edit: QtWidgets.QTextEdit = QtWidgets.QTextEdit()
self.msg_edit.setReadOnly(True)

copy_button: QtWidgets.QPushButton = QtWidgets.QPushButton("复制")
copy_button: QtWidgets.QPushButton = QtWidgets.QPushButton("Copy")
copy_button.clicked.connect(self._copy_text)

community_button: QtWidgets.QPushButton = QtWidgets.QPushButton("求助")
community_button: QtWidgets.QPushButton = QtWidgets.QPushButton("Help")
community_button.clicked.connect(self._open_community)

close_button: QtWidgets.QPushButton = QtWidgets.QPushButton("关闭")
close_button: QtWidgets.QPushButton = QtWidgets.QPushButton("Close")
close_button.clicked.connect(self.close)

hbox: QtWidgets.QHBoxLayout = QtWidgets.QHBoxLayout()
Expand Down
Loading

0 comments on commit 60fbeab

Please sign in to comment.