diff --git a/imgui_demo.cpp b/imgui_demo.cpp index aa92115bd..5a4cd34ce 100644 --- a/imgui_demo.cpp +++ b/imgui_demo.cpp @@ -8846,40 +8846,38 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref) void ImGui::ShowUserGuide() { ImGuiIO& io = GetIO(); - BulletText("Double-click on title bar to collapse window."); - BulletText( - "Click and drag on lower corner or border to resize window.\n" - "(double-click to auto fit window to its contents)"); - BulletText("Ctrl+Click on a slider or drag box to input value as text."); - BulletText("Tab/Shift+Tab to cycle through keyboard editable fields."); - BulletText("Ctrl+Tab/Ctrl+Shift+Tab to focus windows."); + BulletText("%s", Tr("Double-click on title bar to collapse window.")); + BulletText("%s", Tr("Click and drag on lower corner or border to resize window.\n(double-click to auto fit window to its contents)")); + BulletText("%s", Tr("Ctrl+Click on a slider or drag box to input value as text.")); + BulletText("%s", Tr("Tab/Shift+Tab to cycle through keyboard editable fields.")); + BulletText("%s", Tr("Ctrl+Tab/Ctrl+Shift+Tab to focus windows.")); if (io.FontAllowUserScaling) - BulletText("Ctrl+Mouse Wheel to zoom window contents."); - BulletText("While inputting text:\n"); + BulletText("%s", Tr("Ctrl+Mouse Wheel to zoom window contents.")); + BulletText("%s", Tr("While inputting text:")); Indent(); - BulletText("Ctrl+Left/Right to word jump."); - BulletText("Ctrl+A or double-click to select all."); - BulletText("Ctrl+X/C/V to use clipboard cut/copy/paste."); - BulletText("Ctrl+Z to undo, Ctrl+Y/Ctrl+Shift+Z to redo."); - BulletText("Escape to revert."); + BulletText("%s", Tr("Ctrl+Left/Right to word jump.")); + BulletText("%s", Tr("Ctrl+A or double-click to select all.")); + BulletText("%s", Tr("Ctrl+X/C/V to use clipboard cut/copy/paste.")); + BulletText("%s", Tr("Ctrl+Z to undo, Ctrl+Y/Ctrl+Shift+Z to redo.")); + BulletText("%s", Tr("Escape to revert.")); Unindent(); - BulletText("With Keyboard controls enabled:"); + BulletText("%s", Tr("With Keyboard controls enabled:")); Indent(); - BulletText("Arrow keys or Home/End/PageUp/PageDown to navigate."); - BulletText("Space to activate a widget."); - BulletText("Return to input text into a widget."); - BulletText("Escape to deactivate a widget, close popup,\nexit a child window or the menu layer, clear focus."); - BulletText("Alt to jump to the menu layer of a window."); - BulletText("Menu or Shift+F10 to open a context menu."); + BulletText("%s", Tr("Arrow keys or Home/End/PageUp/PageDown to navigate.")); + BulletText("%s", Tr("Space to activate a widget.")); + BulletText("%s", Tr("Return to input text into a widget.")); + BulletText("%s", Tr("Escape to deactivate a widget, close popup,\nexit a child window or the menu layer, clear focus.")); + BulletText("%s", Tr("Alt to jump to the menu layer of a window.")); + BulletText("%s", Tr("Menu or Shift+F10 to open a context menu.")); Unindent(); - BulletText("With Gamepad controls enabled:"); + BulletText("%s", Tr("With Gamepad controls enabled:")); Indent(); - BulletText("D-Pad: Navigate / Tweak / Resize (in Windowing mode)."); - BulletText("%s Face button: Activate / Open / Toggle. Hold: activate with text input.", io.ConfigNavSwapGamepadButtons ? "East" : "South"); - BulletText("%s Face button: Cancel / Close / Exit.", io.ConfigNavSwapGamepadButtons ? "South" : "East"); - BulletText("West Face button: Toggle Menu. Hold for Windowing mode (Focus/Move/Resize windows)."); - BulletText("North Face button: Open Context Menu."); - BulletText("L1/R1: Tweak Slower/Faster, Focus Previous/Next (in Windowing Mode)."); + BulletText("%s", Tr("D-Pad: Navigate / Tweak / Resize (in Windowing mode).")); + BulletText(Tr("%s Face button: Activate / Open / Toggle. Hold: activate with text input."), io.ConfigNavSwapGamepadButtons ? "East" : "South"); + BulletText(Tr("%s Face button: Cancel / Close / Exit."), io.ConfigNavSwapGamepadButtons ? "South" : "East"); + BulletText("%s", Tr("West Face button: Toggle Menu. Hold for Windowing mode (Focus/Move/Resize windows).")); + BulletText("%s", Tr("North Face button: Open Context Menu.")); + BulletText("%s", Tr("L1/R1: Tweak Slower/Faster, Focus Previous/Next (in Windowing Mode).")); Unindent(); } diff --git a/misc/i18n/locale/zh_CN.cpp b/misc/i18n/locale/zh_CN.cpp index 737d75a53..b79c3e65d 100644 --- a/misc/i18n/locale/zh_CN.cpp +++ b/misc/i18n/locale/zh_CN.cpp @@ -794,6 +794,33 @@ struct ZhCNRegistrar { {"Set 'io.ConfigFlags |= NavEnableKeyboard' for keyboard controls.", "设置 'io.ConfigFlags |= NavEnableKeyboard' 以启用键盘控制。"}, {"Set 'io.ConfigFlags |= NavEnableGamepad' for gamepad controls.", "设置 'io.ConfigFlags |= NavEnableGamepad' 以启用手柄控制。"}, {"USER GUIDE:", "用户指南:"}, + // === User Guide (ShowUserGuide) === + {"Double-click on title bar to collapse window.", "双击标题栏折叠窗口。"}, + {"Click and drag on lower corner or border to resize window.\n(double-click to auto fit window to its contents)", "拖拽右下角或边框调整窗口大小。\n(双击自动适应内容)"}, + {"Ctrl+Click on a slider or drag box to input value as text.", "Ctrl+点击滑块或拖拽框,可直接输入数值。"}, + {"Tab/Shift+Tab to cycle through keyboard editable fields.", "Tab/Shift+Tab 在可编辑字段间切换。"}, + {"Ctrl+Tab/Ctrl+Shift+Tab to focus windows.", "Ctrl+Tab/Ctrl+Shift+Tab 切换窗口焦点。"}, + {"Ctrl+Mouse Wheel to zoom window contents.", "Ctrl+滚轮缩放窗口内容。"}, + {"While inputting text:", "输入文字时:"}, + {"Ctrl+Left/Right to word jump.", "Ctrl+左/右方向键按单词跳转。"}, + {"Ctrl+A or double-click to select all.", "Ctrl+A 或双击全选。"}, + {"Ctrl+X/C/V to use clipboard cut/copy/paste.", "Ctrl+X/C/V 剪切/复制/粘贴。"}, + {"Ctrl+Z to undo, Ctrl+Y/Ctrl+Shift+Z to redo.", "Ctrl+Z 撤销,Ctrl+Y/Ctrl+Shift+Z 重做。"}, + {"Escape to revert.", "Escape 还原。"}, + {"With Keyboard controls enabled:", "启用键盘控制后:"}, + {"Arrow keys or Home/End/PageUp/PageDown to navigate.", "方向键或 Home/End/PageUp/PageDown 导航。"}, + {"Space to activate a widget.", "空格键激活控件。"}, + {"Return to input text into a widget.", "Enter 键向控件输入文字。"}, + {"Escape to deactivate a widget, close popup,\nexit a child window or the menu layer, clear focus.", "Escape 键取消激活控件、关闭弹窗、\n退出子窗口或菜单层、清除焦点。"}, + {"Alt to jump to the menu layer of a window.", "Alt 键跳转到窗口菜单层。"}, + {"Menu or Shift+F10 to open a context menu.", "Menu 或 Shift+F10 打开右键菜单。"}, + {"With Gamepad controls enabled:", "启用手柄控制后:"}, + {"D-Pad: Navigate / Tweak / Resize (in Windowing mode).", "方向键:导航/调整/缩放(窗口模式)。"}, + {"%s Face button: Activate / Open / Toggle. Hold: activate with text input.", "%s 键:激活/打开/切换。长按:激活并输入文字。"}, + {"%s Face button: Cancel / Close / Exit.", "%s 键:取消/关闭/退出。"}, + {"West Face button: Toggle Menu. Hold for Windowing mode (Focus/Move/Resize windows).", "West 键:切换菜单。长按进入窗口模式(聚焦/移动/缩放)。"}, + {"North Face button: Open Context Menu.", "North 键:打开右键菜单。"}, + {"L1/R1: Tweak Slower/Faster, Focus Previous/Next (in Windowing Mode).", "L1/R1:慢速/快速调整,切换焦点(窗口模式)。"}, // === Configuration panel HelpMarker tooltips === {"Enable keyboard controls.", "启用键盘控制。"}, {"Enable gamepad controls. Require backend to set io.BackendFlags |= ImGuiBackendFlags_HasGamepad.\n\nRead instructions in imgui.cpp for details.", "启用手柄控制。需要后端设置 io.BackendFlags |= ImGuiBackendFlags_HasGamepad。\n\n详情请阅读 imgui.cpp 中的说明。"},