Fix: Decode GBK dialog/toolbar text on non-Chinese systems

MBCS dialog templates are decoded with the system ANSI code page, so on
non-Chinese systems the GBK template strings turn into "?" before
TranslateDialog can read them. Set those strings explicitly in OnInitDialog
(PluginSettings save/close, the three Advanced dialogs, the file-manager
search buttons/checkboxes, and Trigger Settings) so they are re-decoded
with the thread locale. Also fix the language-selection dialog and the
toolbar "Lang/语言" button: the language dialog's template is built as
WCHAR strings but created through the ANSI path, so its title, label, and
buttons are set explicitly in OnInitDialog (AppendString stays on CP_ACP),
with the title looked up via _TR("切换语言") and set through SetWindowTextW
after an explicit GBK conversion; new en_US ("Switch Language") and zh_TW
("切換語言") translations accompany it. The toolbar button is set through
the Unicode TB_SETBUTTONINFOW message after an explicit GBK conversion. Add
en_US/zh_TW translations for the experimental-features context menu items.

Co-Authored-By: deepseek-v4-pro
This commit is contained in:
yuanyuanxianganddeepseek-v4-pro committed 2026-10-08 21:53:53 +02:00
1 parent c7f7b7b29b
commit 6220335f63
12 files changed
+136 -9

No files matched your search

@@ -157,6 +157,15 @@ BOOL CFileManagerDlg::OnInitDialog()
SetDlgItemText(IDC_STATIC_FILE_WINOS_SEARCH, _TR("搜索文件名:"));
SetDlgItemText(IDC_STATIC_FILE_WINOS_PATH, _TR("路径:"));
// 多语言翻译 - 按钮/复选框(模板文字在非中文系统会被系统 ACP 转成 "?",须显式设置)
SetDlgItemText(IDC_CK_SUBFORDLE, _TR("包含子文件夹"));
SetDlgItemText(IDC_BTN_SEARCH, _TR("开始搜索"));
SetDlgItemText(ID_SEARCH_STOP, _TR("停止搜索"));
SetDlgItemText(ID_SEARCH_RESULT, _TR("搜索栏"));
SetDlgItemText(IDT_REMOTE_PREV, _TR("上一层"));
SetDlgItemText(IDT_REMOTE_VIEW, _TR("切换显示"));
SetDlgItemText(IDT_REMOTE_STOP, _TR("取消"));
RECT rect;
GetClientRect(&rect);