diff --git a/plugins/builtin/source/lang/zh_CN.cpp b/plugins/builtin/source/lang/zh_CN.cpp index 3c5b3e1e1..c4e170a75 100644 --- a/plugins/builtin/source/lang/zh_CN.cpp +++ b/plugins/builtin/source/lang/zh_CN.cpp @@ -599,14 +599,14 @@ namespace hex::plugin::builtin { { "hex.builtin.setting.interface.language", "语言" }, { "hex.builtin.setting.interface.fps", "FPS限制" }, { "hex.builtin.setting.interface.highlight_alpha", "高亮不透明度" }, - //{ "hex.builtin.setting.hex_editor", "Hex Editor" }, - //{ "hex.builtin.setting.hex_editor.column_count", "Byte column count" }, - //{ "hex.builtin.setting.hex_editor.hexii", "Display HexII instead of Bytes" }, - //{ "hex.builtin.setting.hex_editor.ascii", "Display ASCII column" }, - //{ "hex.builtin.setting.hex_editor.advanced_decoding", "Display advanced decoding column" }, - //{ "hex.builtin.setting.hex_editor.grey_zeros", "Grey out zeros" }, - //{ "hex.builtin.setting.hex_editor.uppercase_hex", "Upper case Hex characters" }, - //{ "hex.builtin.setting.hex_editor.extra_info", "Display extra information" }, + { "hex.builtin.setting.hex_editor", "Hex编辑器" }, + { "hex.builtin.setting.hex_editor.column_count", "字节列数" }, + { "hex.builtin.setting.hex_editor.hexii", "显示HexII替代字节" }, + { "hex.builtin.setting.hex_editor.ascii", "显示ASCII栏" }, + { "hex.builtin.setting.hex_editor.advanced_decoding", "显示高级解码栏" }, + { "hex.builtin.setting.hex_editor.grey_zeros", "显示零字节为灰色" }, + { "hex.builtin.setting.hex_editor.uppercase_hex", "大写Hex字符" }, + { "hex.builtin.setting.hex_editor.extra_info", "显示额外信息" }, { "hex.builtin.provider.file.path", "路径" }, { "hex.builtin.provider.file.size", "大小" }, diff --git a/plugins/windows/source/lang/en_US.cpp b/plugins/windows/source/lang/en_US.cpp index aa697ee25..d44d250e7 100644 --- a/plugins/windows/source/lang/en_US.cpp +++ b/plugins/windows/source/lang/en_US.cpp @@ -17,6 +17,7 @@ namespace hex::plugin::windows { { "hex.windows.view.tty_console.connect", "Connect" }, { "hex.windows.view.tty_console.disconnect", "Disconnect" }, { "hex.windows.view.tty_console.connect_error", "Failed to connect to COM Port!" }, + { "hex.windows.view.tty_console.no_available_port", "No valid COM port is selected or no COM port is available!" }, { "hex.windows.view.tty_console.clear", "Clear" }, { "hex.windows.view.tty_console.auto_scroll", "Auto scroll" }, { "hex.windows.view.tty_console.console", "Console" }, diff --git a/plugins/windows/source/lang/zh_CN.cpp b/plugins/windows/source/lang/zh_CN.cpp index 91e3d6b00..aff869ff0 100644 --- a/plugins/windows/source/lang/zh_CN.cpp +++ b/plugins/windows/source/lang/zh_CN.cpp @@ -8,7 +8,7 @@ namespace hex::plugin::windows { { "hex.windows.view.tty_console.name", "TTY控制台" }, { "hex.windows.view.tty_console.config", "配置"}, { "hex.windows.view.tty_console.port", "端口" }, - { "hex.windows.view.tty_console.reload", "重载" }, + { "hex.windows.view.tty_console.reload", "刷新" }, { "hex.windows.view.tty_console.baud", "波特率" }, { "hex.windows.view.tty_console.num_bits", "数据位" }, { "hex.windows.view.tty_console.stop_bits", "终止位" }, @@ -17,6 +17,7 @@ namespace hex::plugin::windows { { "hex.windows.view.tty_console.connect", "连接" }, { "hex.windows.view.tty_console.disconnect", "断开" }, { "hex.windows.view.tty_console.connect_error", "无法连接到COM端口!" }, + { "hex.windows.view.tty_console.no_available_port", "未选择有效的COM端口或无可用COM端口!" }, { "hex.windows.view.tty_console.clear", "清除" }, { "hex.windows.view.tty_console.auto_scroll", "自动滚动" }, { "hex.windows.view.tty_console.console", "控制台" }, diff --git a/plugins/windows/source/views/view_tty_console.cpp b/plugins/windows/source/views/view_tty_console.cpp index 0e831e5c7..8e65b472b 100644 --- a/plugins/windows/source/views/view_tty_console.cpp +++ b/plugins/windows/source/views/view_tty_console.cpp @@ -178,6 +178,10 @@ namespace hex::plugin::windows { } bool ViewTTYConsole::connect() { + if(this->m_comPorts.size() == 0 || this->m_selectedPort >= this->m_comPorts.size()) { + View::showErrorPopup("hex.windows.view.tty_console.no_available_port"_lang); + return true; // If false, connect_error error popup will override this error popup + } this->m_portHandle = ::CreateFile(("\\\\.\\" + this->m_comPorts[this->m_selectedPort].first).c_str(), GENERIC_READ | GENERIC_WRITE, 0, diff --git a/source/window/window.cpp b/source/window/window.cpp index 9516e07a0..9e837fe5d 100644 --- a/source/window/window.cpp +++ b/source/window/window.cpp @@ -337,7 +337,7 @@ namespace hex { if (ImGui::BeginMenu("hex.menu.view"_lang)) { for (auto &view : ContentRegistry::Views::getEntries()) { if (view->hasViewMenuItemEntry()) - ImGui::MenuItem((LangEntry(view->getUnlocalizedName()) + " " + "hex.menu.view"_lang).c_str(), "", &view->getWindowOpenState()); + ImGui::MenuItem(LangEntry(view->getUnlocalizedName()), "", &view->getWindowOpenState()); } ImGui::EndMenu(); }