Revision: 9632 https://osdn.net/projects/ttssh2/scm/svn/commits/9632 Author: zmatsuo Date: 2021-12-25 19:36:09 +0900 (Sat, 25 Dec 2021) Log Message: ----------- 変更できるところは UILanguageFile のUnicode版を使用するよう修正 Modified Paths: -------------- trunk/teraterm/ttpdlg/ttdlg.c -------------- next part -------------- Modified: trunk/teraterm/ttpdlg/ttdlg.c =================================================================== --- trunk/teraterm/ttpdlg/ttdlg.c 2021-12-25 10:35:59 UTC (rev 9631) +++ trunk/teraterm/ttpdlg/ttdlg.c 2021-12-25 10:36:09 UTC (rev 9632) @@ -172,7 +172,7 @@ ts = (PTTSet)lParam; SetWindowLongPtr(Dialog, DWLP_USER, lParam); - SetDlgTexts(Dialog, TextInfosCom, _countof(TextInfosCom), UILanguageFile); + SetDlgTextsW(Dialog, TextInfosCom, _countof(TextInfosCom), ts->UILanguageFileW); if (ts->Language==IdJapanese) { static const DlgTextInfo TextInfosJp[] = { { IDC_TERMKANJILABEL, "DLG_TERM_KANJI" }, @@ -182,7 +182,7 @@ { IDC_TERMKINTEXT, "DLG_TERM_KIN" }, { IDC_TERMKOUTTEXT, "DLG_TERM_KOUT" }, }; - SetDlgTexts(Dialog, TextInfosJp, _countof(TextInfosJp), UILanguageFile); + SetDlgTextsW(Dialog, TextInfosJp, _countof(TextInfosJp), ts->UILanguageFileW); } else if ( ts->Language==IdRussian ) { // TODO @@ -193,7 +193,7 @@ { IDC_TERMKANJILABEL, "DLG_TERM_RUSSCLIENT" }, { IDC_TERMKANJISENDLABEL, "DLG_TERM_RUSSHOST" }, }; - SetDlgTexts(Dialog, TextInfosRu, _countof(TextInfosRu), UILanguageFile); + SetDlgTextsW(Dialog, TextInfosRu, _countof(TextInfosRu), ts->UILanguageFileW); } else if (ts->Language==IdUtf8 || ts->Language==IdKorean || ts->Language == IdChinese) { static const DlgTextInfo TextInfosKo[] = { @@ -200,7 +200,7 @@ { IDC_TERMKANJILABEL, "DLG_TERMK_KANJI" }, { IDC_TERMKANJISENDLABEL, "DLG_TERMK_KANJISEND" }, }; - SetDlgTexts(Dialog, TextInfosKo, _countof(TextInfosKo), UILanguageFile); + SetDlgTextsW(Dialog, TextInfosKo, _countof(TextInfosKo), ts->UILanguageFileW); } SetDlgItemInt(Dialog,IDC_TERMWIDTH,ts->TerminalWidth,FALSE); @@ -548,7 +548,7 @@ ts = (PTTSet)lParam; SetWindowLongPtr(Dialog, DWLP_USER, lParam); - SetDlgTexts(Dialog, TextInfos, _countof(TextInfos), UILanguageFile); + SetDlgTextsW(Dialog, TextInfos, _countof(TextInfos), ts->UILanguageFileW); SetDlgItemTextA(Dialog, IDC_WINTITLE, ts->Title); SendDlgItemMessage(Dialog, IDC_WINTITLE, EM_LIMITTEXT, sizeof(ts->Title)-1, 0); @@ -560,7 +560,7 @@ if (ts->VTFlag>0) { wchar_t *uimsg; - GetI18nStrWA("Tera Term", "DLG_WIN_PCBOLD16", L"&16 Colors (PC style)", UILanguageFile, &uimsg); + GetI18nStrWW("Tera Term", "DLG_WIN_PCBOLD16", L"&16 Colors (PC style)", ts->UILanguageFileW, &uimsg); SetDlgItemTextW(Dialog, IDC_WINCOLOREMU, uimsg); free(uimsg); @@ -647,9 +647,7 @@ { "DLG_WIN_REVERSEATTR", L"Reverse" }, { NULL, L"URL" }, }; - wchar_t *UILanguageFileW = ToWcharA(UILanguageFile); - SetI18nListW("Tera Term", Dialog, IDC_WINATTR, infos, _countof(infos), UILanguageFileW, 1); - free(UILanguageFileW); + SetI18nListW("Tera Term", Dialog, IDC_WINATTR, infos, _countof(infos), ts->UILanguageFileW, 1); } #ifdef USE_NORMAL_BGCOLOR ShowDlgItem(Dialog,IDC_WINUSENORMALBG,IDC_WINUSENORMALBG); @@ -1047,7 +1045,7 @@ ts = (PTTSet)lParam; SetWindowLongPtr(Dialog, DWLP_USER, lParam); - SetDlgTexts(Dialog, TextInfos, _countof(TextInfos), UILanguageFile); + SetDlgTextsW(Dialog, TextInfos, _countof(TextInfos), ts->UILanguageFileW); SetRB(Dialog,ts->BSKey-1,IDC_KEYBBS,IDC_KEYBBS); SetRB(Dialog,ts->DelKey,IDC_KEYBDEL,IDC_KEYBDEL); @@ -1128,7 +1126,7 @@ * \x83V\x83\x8A\x83A\x83\x8B\x83|\x81[\x83g\x90ݒ\xE8\x83_\x83C\x83A\x83\x8D\x83O\x82\xCCOK\x83{\x83^\x83\x93\x82\xF0\x90ڑ\xB1\x90\xE6\x82ɉ\x9E\x82\xB6\x82Ė\xBC\x8F̂\xF0\x90\xE8\x91ւ\xA6\x82\xE9\x81B * \x8F\xF0\x8C\x8F\x94\xBB\x92\xE8\x82\xCD OnSetupSerialPort() \x82ƍ\x87\x82킹\x82\xE9\x95K\x97v\x82\xAA\x82\xA0\x82\xE9\x81B */ -static void serial_dlg_change_OK_button(HWND dlg, int portno) +static void serial_dlg_change_OK_button(HWND dlg, int portno, const wchar_t *UILanguageFileW) { static const DlgTextInfo TextInfoNewConnection[] = { { IDOK, "DLG_SERIAL_OK_CONNECTION" }, @@ -1146,21 +1144,21 @@ const char *ok_text; if ( cv.Ready && (cv.PortType != IdSerial) ) { - ret = SetDlgTexts(dlg, TextInfoNewConnection, _countof(TextInfoNewConnection), UILanguageFile); + ret = SetDlgTextsW(dlg, TextInfoNewConnection, _countof(TextInfoNewConnection), UILanguageFileW); ok_text = "Connect with &New window"; } else { if (cv.Open) { if (portno != cv.ComPort) { - ret = SetDlgTexts(dlg, TextInfoCloseNewOpen, _countof(TextInfoCloseNewOpen), UILanguageFile); + ret = SetDlgTextsW(dlg, TextInfoCloseNewOpen, _countof(TextInfoCloseNewOpen), UILanguageFileW); ok_text = "Close and &New open"; } else { - ret = SetDlgTexts(dlg, TextInfoResetSetting, _countof(TextInfoResetSetting), UILanguageFile); + ret = SetDlgTextsW(dlg, TextInfoResetSetting, _countof(TextInfoResetSetting), UILanguageFileW); ok_text = "&New setting"; } } else { - ret = SetDlgTexts(dlg, TextInfoNewOpen, _countof(TextInfoNewOpen), UILanguageFile); + ret = SetDlgTextsW(dlg, TextInfoNewOpen, _countof(TextInfoNewOpen), UILanguageFileW); ok_text = "&New open"; } } @@ -1317,7 +1315,7 @@ ts = (PTTSet)lParam; SetWindowLongPtr(Dialog, DWLP_USER, lParam); - SetDlgTexts(Dialog, TextInfos, _countof(TextInfos), UILanguageFile); + SetDlgTexts(Dialog, TextInfos, _countof(TextInfos), ts->UILanguageFile); EnableDlgItem(Dialog, IDC_SERIALPORT, IDC_SERIALPORT); EnableDlgItem(Dialog, IDC_SERIALPORT_LABEL, IDC_SERIALPORT_LABEL); @@ -1326,7 +1324,7 @@ // COM\x83|\x81[\x83g\x82̏ڍ\xEE\x95\xF1\x82\xF0\x8E擾\x82\xB7\x82\xE9\x81B // COM\x82̐ڑ\xB1\x8F͓s\x93x\x95ς\xED\x82邽\x82߁A\x83_\x83C\x83A\x83\x8D\x83O\x82\xF0\x95\\x8E\xA6\x82\xB7\x82\xE9\x93x\x82Ɏ擾\x82\xB7\x82\xE9\x81B // \x95s\x97v\x82ɂȂ\xC1\x82\xBD\x82\xE7\x81AComPortInfoFree()\x82Ń\x81\x83\x82\x83\x8A\x82\xF0\x89\xF0\x95\xFA\x82\xB7\x82邱\x82ƁB - ComPortInfoPtr = ComPortInfoGet(&ComPortInfoCount, UILanguageFile); + ComPortInfoPtr = ComPortInfoGet(&ComPortInfoCount, ts->UILanguageFile); w = 0; @@ -1428,7 +1426,7 @@ // \x8C\xBB\x8D݂̐ڑ\xB1\x8F\xF3\x91ԂƐV\x82\xB5\x82\xA2\x83|\x81[\x83g\x94ԍ\x86\x82̑g\x82ݍ\x87\x82킹\x82ŁA\x90ڑ\xB1\x8F\x88\x97\x9D\x82\xAA\x95ς\xED\x82邽\x82߁A // \x82\xBB\x82\xEA\x82ɉ\x9E\x82\xB6\x82\xC4OK\x83{\x83^\x83\x93\x82̃\x89\x83x\x83\x8B\x96\xBC\x82\xF0\x90\xE8\x91ւ\xA6\x82\xE9\x81B - serial_dlg_change_OK_button(Dialog, ComPortTable[w]); + serial_dlg_change_OK_button(Dialog, ComPortTable[w], ts->UILanguageFileW); return TRUE; @@ -1526,7 +1524,7 @@ // \x8C\xBB\x8D݂̐ڑ\xB1\x8F\xF3\x91ԂƐV\x82\xB5\x82\xA2\x83|\x81[\x83g\x94ԍ\x86\x82̑g\x82ݍ\x87\x82킹\x82ŁA\x90ڑ\xB1\x8F\x88\x97\x9D\x82\xAA\x95ς\xED\x82邽\x82߁A // \x82\xBB\x82\xEA\x82ɉ\x9E\x82\xB6\x82\xC4OK\x83{\x83^\x83\x93\x82̃\x89\x83x\x83\x8B\x96\xBC\x82\xF0\x90\xE8\x91ւ\xA6\x82\xE9\x81B - serial_dlg_change_OK_button(Dialog, portno); + serial_dlg_change_OK_button(Dialog, portno, ts->UILanguageFileW); break; @@ -2022,7 +2020,7 @@ ts = (PTTSet)lParam; CurDir = ts->FileDirW; SetWindowLongPtr(Dialog, DWLP_USER, lParam); - SetDlgTexts(Dialog, TextInfos, _countof(TextInfos), UILanguageFile); + SetDlgTextsW(Dialog, TextInfos, _countof(TextInfos), ts->UILanguageFileW); SetDlgItemTextW(Dialog, IDC_DIRCURRENT, CurDir); // adjust dialog size