From 60fbeab8778e24c51ea131e14d4b56c105030f2f Mon Sep 17 00:00:00 2001 From: "vn.py" Date: Wed, 20 Dec 2023 22:01:42 +0800 Subject: [PATCH] [Mod] translation ui language to English --- vnpy/trader/ui/mainwindow.py | 46 ++++---- vnpy/trader/ui/qt.py | 8 +- vnpy/trader/ui/widget.py | 218 +++++++++++++++++------------------ 3 files changed, 136 insertions(+), 136 deletions(-) diff --git a/vnpy/trader/ui/mainwindow.py b/vnpy/trader/ui/mainwindow.py index c7d257f..6f670ed 100644 --- a/vnpy/trader/ui/mainwindow.py +++ b/vnpy/trader/ui/mainwindow.py @@ -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] = {} @@ -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) @@ -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 ) @@ -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: @@ -132,16 +132,16 @@ 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 @@ -149,21 +149,21 @@ def init_menu(self) -> None: 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 @@ -171,7 +171,7 @@ def init_menu(self) -> None: self.add_action( help_menu, - "关于", + "About", get_icon_path(__file__, "about.ico"), partial(self.open_widget, AboutDialog, "about"), ) @@ -179,7 +179,7 @@ def init_menu(self) -> None: 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) @@ -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, ) diff --git a/vnpy/trader/ui/qt.py b/vnpy/trader/ui/qt.py index 87a16a8..d1ddd3a 100644 --- a/vnpy/trader/ui/qt.py +++ b/vnpy/trader/ui/qt.py @@ -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() diff --git a/vnpy/trader/ui/widget.py b/vnpy/trader/ui/widget.py index 7e41a62..a1ff783 100644 --- a/vnpy/trader/ui/widget.py +++ b/vnpy/trader/ui/widget.py @@ -261,11 +261,11 @@ def init_menu(self) -> None: """ self.menu: QtWidgets.QMenu = QtWidgets.QMenu(self) - resize_action: QtGui.QAction = QtWidgets.QAction("调整列宽", self) + resize_action: QtGui.QAction = QtWidgets.QAction("Resize Columns", self) resize_action.triggered.connect(self.resize_columns) self.menu.addAction(resize_action) - save_action: QtGui.QAction = QtWidgets.QAction("保存数据", self) + save_action: QtGui.QAction = QtWidgets.QAction("Save Data", self) save_action.triggered.connect(self.save_csv) self.menu.addAction(save_action) @@ -345,7 +345,7 @@ def save_csv(self) -> None: Save table data into a csv file """ path, _ = QtWidgets.QFileDialog.getSaveFileName( - self, "保存数据", "", "CSV(*.csv)") + self, "Save Data", "", "CSV(*.csv)") if not path: return @@ -400,20 +400,20 @@ class TickMonitor(BaseMonitor): sorting: bool = True headers: dict = { - "symbol": {"display": "代码", "cell": BaseCell, "update": False}, - "exchange": {"display": "交易所", "cell": EnumCell, "update": False}, - "name": {"display": "名称", "cell": BaseCell, "update": True}, - "last_price": {"display": "最新价", "cell": BaseCell, "update": True}, - "volume": {"display": "成交量", "cell": BaseCell, "update": True}, - "open_price": {"display": "开盘价", "cell": BaseCell, "update": True}, - "high_price": {"display": "最高价", "cell": BaseCell, "update": True}, - "low_price": {"display": "最低价", "cell": BaseCell, "update": True}, - "bid_price_1": {"display": "买1价", "cell": BidCell, "update": True}, - "bid_volume_1": {"display": "买1量", "cell": BidCell, "update": True}, - "ask_price_1": {"display": "卖1价", "cell": AskCell, "update": True}, - "ask_volume_1": {"display": "卖1量", "cell": AskCell, "update": True}, - "datetime": {"display": "时间", "cell": TimeCell, "update": True}, - "gateway_name": {"display": "接口", "cell": BaseCell, "update": False}, + "symbol": {"display": "Symbol", "cell": BaseCell, "update": False}, + "exchange": {"display": "Exchange", "cell": EnumCell, "update": False}, + "name": {"display": "Name", "cell": BaseCell, "update": True}, + "last_price": {"display": "Last", "cell": BaseCell, "update": True}, + "volume": {"display": "Volume", "cell": BaseCell, "update": True}, + "open_price": {"display": "Open", "cell": BaseCell, "update": True}, + "high_price": {"display": "High", "cell": BaseCell, "update": True}, + "low_price": {"display": "Low", "cell": BaseCell, "update": True}, + "bid_price_1": {"display": "Bid Price", "cell": BidCell, "update": True}, + "bid_volume_1": {"display": "Bid Volume", "cell": BidCell, "update": True}, + "ask_price_1": {"display": "Ask Price", "cell": AskCell, "update": True}, + "ask_volume_1": {"display": "Ask Volume", "cell": AskCell, "update": True}, + "datetime": {"display": "Time", "cell": TimeCell, "update": True}, + "gateway_name": {"display": "Gateway", "cell": BaseCell, "update": False}, } @@ -427,9 +427,9 @@ class LogMonitor(BaseMonitor): sorting: bool = False headers: dict = { - "time": {"display": "时间", "cell": TimeCell, "update": False}, - "msg": {"display": "信息", "cell": MsgCell, "update": False}, - "gateway_name": {"display": "接口", "cell": BaseCell, "update": False}, + "time": {"display": "Time", "cell": TimeCell, "update": False}, + "msg": {"display": "Message", "cell": MsgCell, "update": False}, + "gateway_name": {"display": "Gateway", "cell": BaseCell, "update": False}, } @@ -443,16 +443,16 @@ class TradeMonitor(BaseMonitor): sorting: bool = True headers: dict = { - "tradeid": {"display": "成交号 ", "cell": BaseCell, "update": False}, - "orderid": {"display": "委托号", "cell": BaseCell, "update": False}, - "symbol": {"display": "代码", "cell": BaseCell, "update": False}, - "exchange": {"display": "交易所", "cell": EnumCell, "update": False}, - "direction": {"display": "方向", "cell": DirectionCell, "update": False}, - "offset": {"display": "开平", "cell": EnumCell, "update": False}, - "price": {"display": "价格", "cell": BaseCell, "update": False}, - "volume": {"display": "数量", "cell": BaseCell, "update": False}, - "datetime": {"display": "时间", "cell": TimeCell, "update": False}, - "gateway_name": {"display": "接口", "cell": BaseCell, "update": False}, + "tradeid": {"display": "Trade ID ", "cell": BaseCell, "update": False}, + "orderid": {"display": "Order ID", "cell": BaseCell, "update": False}, + "symbol": {"display": "Symbol", "cell": BaseCell, "update": False}, + "exchange": {"display": "Exchang", "cell": EnumCell, "update": False}, + "direction": {"display": "Direction", "cell": DirectionCell, "update": False}, + "offset": {"display": "Offset", "cell": EnumCell, "update": False}, + "price": {"display": "Price", "cell": BaseCell, "update": False}, + "volume": {"display": "Volume", "cell": BaseCell, "update": False}, + "datetime": {"display": "Time", "cell": TimeCell, "update": False}, + "gateway_name": {"display": "Gateway", "cell": BaseCell, "update": False}, } @@ -466,19 +466,19 @@ class OrderMonitor(BaseMonitor): sorting: bool = True headers: dict = { - "orderid": {"display": "委托号", "cell": BaseCell, "update": False}, - "reference": {"display": "来源", "cell": BaseCell, "update": False}, - "symbol": {"display": "代码", "cell": BaseCell, "update": False}, - "exchange": {"display": "交易所", "cell": EnumCell, "update": False}, - "type": {"display": "类型", "cell": EnumCell, "update": False}, - "direction": {"display": "方向", "cell": DirectionCell, "update": False}, - "offset": {"display": "开平", "cell": EnumCell, "update": False}, - "price": {"display": "价格", "cell": BaseCell, "update": False}, - "volume": {"display": "总数量", "cell": BaseCell, "update": True}, - "traded": {"display": "已成交", "cell": BaseCell, "update": True}, - "status": {"display": "状态", "cell": EnumCell, "update": True}, - "datetime": {"display": "时间", "cell": TimeCell, "update": True}, - "gateway_name": {"display": "接口", "cell": BaseCell, "update": False}, + "orderid": {"display": "Order ID", "cell": BaseCell, "update": False}, + "reference": {"display": "Reference", "cell": BaseCell, "update": False}, + "symbol": {"display": "Symbol", "cell": BaseCell, "update": False}, + "exchange": {"display": "Exchang", "cell": EnumCell, "update": False}, + "type": {"display": "Type", "cell": EnumCell, "update": False}, + "direction": {"display": "Direction", "cell": DirectionCell, "update": False}, + "offset": {"display": "Offset", "cell": EnumCell, "update": False}, + "price": {"display": "Price", "cell": BaseCell, "update": False}, + "volume": {"display": "Volume", "cell": BaseCell, "update": True}, + "traded": {"display": "Traded", "cell": BaseCell, "update": True}, + "status": {"display": "Status", "cell": EnumCell, "update": True}, + "datetime": {"display": "Time", "cell": TimeCell, "update": True}, + "gateway_name": {"display": "Gateway", "cell": BaseCell, "update": False}, } def init_ui(self) -> None: @@ -487,7 +487,7 @@ def init_ui(self) -> None: """ super().init_ui() - self.setToolTip("双击单元格撤单") + self.setToolTip("Double click to cancel.") self.itemDoubleClicked.connect(self.cancel_order) def cancel_order(self, cell: BaseCell) -> None: @@ -509,15 +509,15 @@ class PositionMonitor(BaseMonitor): sorting: bool = True headers: dict = { - "symbol": {"display": "代码", "cell": BaseCell, "update": False}, - "exchange": {"display": "交易所", "cell": EnumCell, "update": False}, - "direction": {"display": "方向", "cell": DirectionCell, "update": False}, - "volume": {"display": "数量", "cell": BaseCell, "update": True}, - "yd_volume": {"display": "昨仓", "cell": BaseCell, "update": True}, - "frozen": {"display": "冻结", "cell": BaseCell, "update": True}, - "price": {"display": "均价", "cell": BaseCell, "update": True}, - "pnl": {"display": "盈亏", "cell": PnlCell, "update": True}, - "gateway_name": {"display": "接口", "cell": BaseCell, "update": False}, + "symbol": {"display": "Symbol", "cell": BaseCell, "update": False}, + "exchange": {"display": "Exchang", "cell": EnumCell, "update": False}, + "direction": {"display": "Direction", "cell": DirectionCell, "update": False}, + "volume": {"display": "Volume", "cell": BaseCell, "update": True}, + "yd_volume": {"display": "Yd Volume", "cell": BaseCell, "update": True}, + "frozen": {"display": "Frozen", "cell": BaseCell, "update": True}, + "price": {"display": "Price", "cell": BaseCell, "update": True}, + "pnl": {"display": "PnL", "cell": PnlCell, "update": True}, + "gateway_name": {"display": "Gateway", "cell": BaseCell, "update": False}, } @@ -531,11 +531,11 @@ class AccountMonitor(BaseMonitor): sorting: bool = True headers: dict = { - "accountid": {"display": "账号", "cell": BaseCell, "update": False}, - "balance": {"display": "余额", "cell": BaseCell, "update": True}, - "frozen": {"display": "冻结", "cell": BaseCell, "update": True}, - "available": {"display": "可用", "cell": BaseCell, "update": True}, - "gateway_name": {"display": "接口", "cell": BaseCell, "update": False}, + "accountid": {"display": "Account", "cell": BaseCell, "update": False}, + "balance": {"display": "Balance", "cell": BaseCell, "update": True}, + "frozen": {"display": "Frozen", "cell": BaseCell, "update": True}, + "available": {"display": "Available", "cell": BaseCell, "update": True}, + "gateway_name": {"display": "Gateway", "cell": BaseCell, "update": False}, } @@ -549,19 +549,19 @@ class QuoteMonitor(BaseMonitor): sorting: bool = True headers: dict = { - "quoteid": {"display": "报价号", "cell": BaseCell, "update": False}, - "reference": {"display": "来源", "cell": BaseCell, "update": False}, - "symbol": {"display": "代码", "cell": BaseCell, "update": False}, - "exchange": {"display": "交易所", "cell": EnumCell, "update": False}, - "bid_offset": {"display": "买开平", "cell": EnumCell, "update": False}, - "bid_volume": {"display": "买量", "cell": BidCell, "update": False}, - "bid_price": {"display": "买价", "cell": BidCell, "update": False}, - "ask_price": {"display": "卖价", "cell": AskCell, "update": False}, - "ask_volume": {"display": "卖量", "cell": AskCell, "update": False}, - "ask_offset": {"display": "卖开平", "cell": EnumCell, "update": False}, - "status": {"display": "状态", "cell": EnumCell, "update": True}, - "datetime": {"display": "时间", "cell": TimeCell, "update": True}, - "gateway_name": {"display": "接口", "cell": BaseCell, "update": False}, + "quoteid": {"display": "Quote ID", "cell": BaseCell, "update": False}, + "reference": {"display": "Reference", "cell": BaseCell, "update": False}, + "symbol": {"display": "Symbol", "cell": BaseCell, "update": False}, + "exchange": {"display": "Exchang", "cell": EnumCell, "update": False}, + "bid_offset": {"display": "Bid Offset", "cell": EnumCell, "update": False}, + "bid_volume": {"display": "Bid Volume", "cell": BidCell, "update": False}, + "bid_price": {"display": "Bid Price", "cell": BidCell, "update": False}, + "ask_price": {"display": "Ask Price", "cell": AskCell, "update": False}, + "ask_volume": {"display": "Ask Volume", "cell": AskCell, "update": False}, + "ask_offset": {"display": "Ask Offset", "cell": EnumCell, "update": False}, + "status": {"display": "Status", "cell": EnumCell, "update": True}, + "datetime": {"display": "Time", "cell": TimeCell, "update": True}, + "gateway_name": {"display": "Gateway", "cell": BaseCell, "update": False}, } def init_ui(self): @@ -570,7 +570,7 @@ def init_ui(self): """ super().init_ui() - self.setToolTip("双击单元格撤销报价") + self.setToolTip("Double click to cancel.") self.itemDoubleClicked.connect(self.cancel_quote) def cancel_quote(self, cell: BaseCell) -> None: @@ -601,7 +601,7 @@ def __init__(self, main_engine: MainEngine, gateway_name: str) -> None: def init_ui(self) -> None: """""" - self.setWindowTitle(f"连接{self.gateway_name}") + self.setWindowTitle(f"Connect {self.gateway_name}") # Default setting provides field name, field data type and field default value. default_setting: dict = self.main_engine.get_default_setting( @@ -641,7 +641,7 @@ def init_ui(self) -> None: form.addRow(f"{field_name} <{field_type.__name__}>", widget) self.widgets[field_name] = (widget, field_type) - button: QtWidgets.QPushButton = QtWidgets.QPushButton("连接") + button: QtWidgets.QPushButton = QtWidgets.QPushButton("Connect") button.clicked.connect(self.connect) form.addRow(button) @@ -728,24 +728,24 @@ def init_ui(self) -> None: self.gateway_combo.addItems(self.main_engine.get_all_gateway_names()) self.price_check: QtWidgets.QCheckBox = QtWidgets.QCheckBox() - self.price_check.setToolTip("设置价格随行情更新") + self.price_check.setToolTip("Update price with market data.") - send_button: QtWidgets.QPushButton = QtWidgets.QPushButton("委托") + send_button: QtWidgets.QPushButton = QtWidgets.QPushButton("Send Order") send_button.clicked.connect(self.send_order) - cancel_button: QtWidgets.QPushButton = QtWidgets.QPushButton("全撤") + cancel_button: QtWidgets.QPushButton = QtWidgets.QPushButton("Cancel All") cancel_button.clicked.connect(self.cancel_all) grid: QtWidgets.QGridLayout = QtWidgets.QGridLayout() - grid.addWidget(QtWidgets.QLabel("交易所"), 0, 0) - grid.addWidget(QtWidgets.QLabel("代码"), 1, 0) - grid.addWidget(QtWidgets.QLabel("名称"), 2, 0) - grid.addWidget(QtWidgets.QLabel("方向"), 3, 0) - grid.addWidget(QtWidgets.QLabel("开平"), 4, 0) - grid.addWidget(QtWidgets.QLabel("类型"), 5, 0) - grid.addWidget(QtWidgets.QLabel("价格"), 6, 0) - grid.addWidget(QtWidgets.QLabel("数量"), 7, 0) - grid.addWidget(QtWidgets.QLabel("接口"), 8, 0) + grid.addWidget(QtWidgets.QLabel("Exchang"), 0, 0) + grid.addWidget(QtWidgets.QLabel("Symbol"), 1, 0) + grid.addWidget(QtWidgets.QLabel("Name"), 2, 0) + grid.addWidget(QtWidgets.QLabel("Direction"), 3, 0) + grid.addWidget(QtWidgets.QLabel("Offset"), 4, 0) + grid.addWidget(QtWidgets.QLabel("Type"), 5, 0) + grid.addWidget(QtWidgets.QLabel("Price"), 6, 0) + grid.addWidget(QtWidgets.QLabel("Volume"), 7, 0) + grid.addWidget(QtWidgets.QLabel("Gateway"), 8, 0) grid.addWidget(self.exchange_combo, 0, 1, 1, 2) grid.addWidget(self.symbol_line, 1, 1, 1, 2) grid.addWidget(self.name_line, 2, 1, 1, 2) @@ -960,12 +960,12 @@ def send_order(self) -> None: """ symbol: str = str(self.symbol_line.text()) if not symbol: - QtWidgets.QMessageBox.critical(self, "委托失败", "请输入合约代码") + QtWidgets.QMessageBox.critical(self, "Sending Order Failed", "Missing order symbol.") return volume_text: str = str(self.volume_line.text()) if not volume_text: - QtWidgets.QMessageBox.critical(self, "委托失败", "请输入委托数量") + QtWidgets.QMessageBox.critical(self, "Sending Order Failed", "Missing order volume.") return volume: float = float(volume_text) @@ -1057,19 +1057,19 @@ class ContractManager(QtWidgets.QWidget): """ headers: Dict[str, str] = { - "vt_symbol": "本地代码", - "symbol": "代码", - "exchange": "交易所", - "name": "名称", - "product": "合约分类", - "size": "合约乘数", - "pricetick": "价格跳动", - "min_volume": "最小委托量", - "option_portfolio": "期权产品", - "option_expiry": "期权到期日", - "option_strike": "期权行权价", - "option_type": "期权类型", - "gateway_name": "交易接口", + "vt_symbol": "Local Symbol", + "symbol": "Symbol", + "exchange": "Exchang", + "name": "Name", + "product": "Product", + "size": "Size", + "pricetick": "Price tick", + "min_volume": "Min Volume", + "option_portfolio": "Option Portfolio", + "option_expiry": "Option Expiry", + "option_strike": "Option Strike", + "option_type": "Option Type", + "gateway_name": "Gateway", } def __init__(self, main_engine: MainEngine, event_engine: EventEngine) -> None: @@ -1082,13 +1082,13 @@ def __init__(self, main_engine: MainEngine, event_engine: EventEngine) -> None: def init_ui(self) -> None: """""" - self.setWindowTitle("合约查询") + self.setWindowTitle("Contract Info") self.resize(1000, 600) self.filter_line: QtWidgets.QLineEdit = QtWidgets.QLineEdit() - self.filter_line.setPlaceholderText("输入合约代码或者交易所,留空则查询所有合约") + self.filter_line.setPlaceholderText("Please input symbol or exchange to filter. Show all contracts if empty.") - self.button_show: QtWidgets.QPushButton = QtWidgets.QPushButton("查询") + self.button_show: QtWidgets.QPushButton = QtWidgets.QPushButton("Show") self.button_show.clicked.connect(self.show_contracts) labels: list = [] @@ -1164,7 +1164,7 @@ def __init__(self, main_engine: MainEngine, event_engine: EventEngine) -> None: def init_ui(self) -> None: """""" - self.setWindowTitle("关于VeighNa Trader") + self.setWindowTitle("About VeighNa Trader") from ... import __version__ as vnpy_version @@ -1210,7 +1210,7 @@ def __init__(self) -> None: def init_ui(self) -> None: """""" - self.setWindowTitle("全局配置") + self.setWindowTitle("Global Setting") self.setMinimumWidth(800) settings: dict = copy(SETTINGS) @@ -1226,7 +1226,7 @@ def init_ui(self) -> None: form.addRow(f"{field_name} <{field_type.__name__}>", widget) self.widgets[field_name] = (widget, field_type) - button: QtWidgets.QPushButton = QtWidgets.QPushButton("确定") + button: QtWidgets.QPushButton = QtWidgets.QPushButton("Confirm") button.clicked.connect(self.update_setting) form.addRow(button) @@ -1262,8 +1262,8 @@ def update_setting(self) -> None: QtWidgets.QMessageBox.information( self, - "注意", - "全局配置的修改需要重启后才会生效!", + "Notice", + "Please restart to update global setting!", QtWidgets.QMessageBox.Ok )