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:
1 parent
c7f7b7b29b
commit
6220335f63
12 files changed
+136
-9
No files matched your search
@@ -89,11 +89,29 @@ protected:
|
||||
{
|
||||
CDialog::OnInitDialog();
|
||||
|
||||
// 非中文系统上 MBCS 对话框模板的中文会被系统 ACP 转成 "?",TranslateDialog
|
||||
// 拿到的是已乱码文本无法还原,故在此显式设置(参照 NotifySettingsDlg)。
|
||||
// 均经 _TR/_L 支持多语言翻译。
|
||||
SetWindowText(_TR("屏幕预览质量等级"));
|
||||
SetDlgItemText(IDC_PLEVEL_LABEL_LEVEL, _TR("等级"));
|
||||
SetDlgItemText(IDC_PLEVEL_LABEL_WIDTH, _TR("最大宽度"));
|
||||
SetDlgItemText(IDC_PLEVEL_LABEL_QUALITY, _TR("JPEG质量"));
|
||||
static const TCHAR* kLevelNames[QUALITY_COUNT] = {
|
||||
_T("Ultra 极佳"), _T("High 优秀"), _T("Good 良好"),
|
||||
_T("Medium 一般"), _T("Low 较差"), _T("Minimal 最低")
|
||||
};
|
||||
for (int i = 0; i < QUALITY_COUNT; i++)
|
||||
SetDlgItemText(IDC_PLEVEL_LABEL_LEVEL0 + i, _L(kLevelNames[i]));
|
||||
SetDlgItemText(IDC_PLEVEL_LABEL_HINT,
|
||||
_TR("最大宽度为期望编码宽度;JPEG 质量 1~100"));
|
||||
SetDlgItemText(IDC_PLEVEL_RESET, _TR("恢复默认"));
|
||||
SetDlgItemText(IDOK, _TR("确定"));
|
||||
SetDlgItemText(IDCANCEL, _TR("取消"));
|
||||
|
||||
for (int i = 0; i < QUALITY_COUNT; i++) {
|
||||
m_working[i] = m_profiles[i];
|
||||
}
|
||||
LoadToControls();
|
||||
TranslateDialog(this);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user