Feature: Add language-switch toolbar button and bilingual dialog

Add a 15th toolbar button "Lang/语言" after the Help button so Chinese
readers can switch language without knowing English; it opens the existing
language-select dialog. The dialog title is now bilingual ("切换语言 /
Switch Language") and its label/buttons use Chinese source strings
("语言:", "确定", "取消"), which still localize to en/de via
TranslateDialog. The toolbar bitmap is extended with a globe icon.

Co-Authored-By: deepseek-v4-pro
This commit is contained in:
yuanyuanxianganddeepseek-v4-pro committed 2026-09-08 16:34:45 +02:00
1 parent 91238da50d
commit 0416dadbba
4 files changed
+10 -9

No files matched your search

Binary file not shown.
+2 -1
View File
@@ -1409,6 +1409,7 @@ VOID CMy2015RemoteDlg::CreateToolBar()
m_ToolBar.SetButtonText(11, _TR("生成服务端")); m_ToolBar.SetButtonText(11, _TR("生成服务端"));
m_ToolBar.SetButtonText(12, _TR("搜索")); m_ToolBar.SetButtonText(12, _TR("搜索"));
m_ToolBar.SetButtonText(13, _TR("帮助")); m_ToolBar.SetButtonText(13, _TR("帮助"));
m_ToolBar.SetButtonText(14, _T("Lang/语言"));
// ============================================================ // ============================================================
// UIBranding: 根据编译时配置或运行时标志隐藏工具栏按钮 // UIBranding: 根据编译时配置或运行时标志隐藏工具栏按钮
@@ -1459,7 +1460,7 @@ VOID CMy2015RemoteDlg::CreateToolBar()
} }
// 如果所有按钮都被隐藏,则隐藏整个工具栏 // 如果所有按钮都被隐藏,则隐藏整个工具栏
if (hiddenCount >= 14) { if (hiddenCount >= 15) {
m_ToolBar.ShowWindow(SW_HIDE); m_ToolBar.ShowWindow(SW_HIDE);
} }
+8 -8
View File
@@ -709,7 +709,7 @@ protected:
LPCDLGTEMPLATE CreateDialogTemplate() LPCDLGTEMPLATE CreateDialogTemplate()
{ {
const WORD DLG_WIDTH = 200; const WORD DLG_WIDTH = 260;
const WORD DLG_HEIGHT = 75; const WORD DLG_HEIGHT = 75;
m_templateBuffer.clear(); m_templateBuffer.clear();
@@ -723,24 +723,24 @@ protected:
AppendData(&dlgTemplate, sizeof(DLGTEMPLATE)); AppendData(&dlgTemplate, sizeof(DLGTEMPLATE));
AppendWord(0); // 菜单 AppendWord(0); // 菜单
AppendWord(0); // 窗口类 AppendWord(0); // 窗口类
AppendString(_T("Select Language")); AppendString(_T("切换语言 / Switch Language"));
AlignToDword(); AlignToDword();
// 静态文本 // 静态文本
AddControl(0x0082, 15, 15, 50, 12, (WORD)-1, AddControl(0x0082, 15, 15, 50, 12, (WORD)-1,
SS_LEFT | WS_CHILD | WS_VISIBLE, _T("Language:")); SS_LEFT | WS_CHILD | WS_VISIBLE, _T("语言:"));
// ComboBox // ComboBox
AddControl(0x0085, 65, 13, 120, 150, 1001, AddControl(0x0085, 65, 13, 180, 150, 1001,
CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, _T("")); CBS_DROPDOWNLIST | WS_CHILD | WS_VISIBLE | WS_TABSTOP | WS_VSCROLL, _T(""));
// OK 按钮 // OK 按钮
AddControl(0x0080, 45, 50, 50, 14, IDOK, AddControl(0x0080, 75, 50, 50, 14, IDOK,
BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, _T("OK")); BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, _T("确定"));
// Cancel 按钮 // Cancel 按钮
AddControl(0x0080, 105, 50, 50, 14, IDCANCEL, AddControl(0x0080, 135, 50, 50, 14, IDCANCEL,
BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, _T("Cancel")); BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, _T("取消"));
return (LPCDLGTEMPLATE)m_templateBuffer.data(); return (LPCDLGTEMPLATE)m_templateBuffer.data();
} }
Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 101 KiB