[Ttssh2-commit] [7346] SetI18DlgStrs(),SetI18MenuStrs()を追加

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2018年 12月 23日 (日) 02:30:33 JST


Revision: 7346
          http://sourceforge.jp/projects/ttssh2/scm/svn/commits/7346
Author:   zmatsuo
Date:     2018-12-23 02:30:33 +0900 (Sun, 23 Dec 2018)
Log Message:
-----------
SetI18DlgStrs(),SetI18MenuStrs()を追加
SetDlgTexts(),SetDlgMenuTexts()は"Tera Term"セクション専用

Modified Paths:
--------------
    branches/cmake/TTProxy/ProxyWSockHook.h
    branches/cmake/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.c
    branches/cmake/teraterm/common/dlglib.c
    branches/cmake/teraterm/common/dlglib.h
    branches/cmake/teraterm/common/i18n.c
    branches/cmake/teraterm/common/i18n.h
    branches/cmake/teraterm/common/teraterm.h
    branches/cmake/teraterm/common/ttlib.c
    branches/cmake/teraterm/common/ttlib.h
    branches/cmake/ttpmenu/CMakeLists.txt
    branches/cmake/ttpmenu/ttpmenu.cpp
    branches/cmake/ttssh2/ttxssh/auth.c
    branches/cmake/ttssh2/ttxssh/fwdui.c
    branches/cmake/ttssh2/ttxssh/hosts.c
    branches/cmake/ttssh2/ttxssh/ssh.c
    branches/cmake/ttssh2/ttxssh/ttxssh.c
    branches/cmake/ttssh2/ttxssh/util.c

-------------- next part --------------
Modified: branches/cmake/TTProxy/ProxyWSockHook.h
===================================================================
--- branches/cmake/TTProxy/ProxyWSockHook.h	2018-12-22 17:30:17 UTC (rev 7345)
+++ branches/cmake/TTProxy/ProxyWSockHook.h	2018-12-22 17:30:33 UTC (rev 7346)
@@ -830,7 +830,7 @@
             }
 
             HWND hWnd = (HWND)this;
-            SetDlgTexts(hWnd, text_info, _countof(text_info), UILanguageFile);
+			SetI18DlgStrs("TTProxy", hWnd, text_info, _countof(text_info), UILanguageFile);
 #if 0
             GetWindowText(uitmp, sizeof(uitmp));
             UTIL_get_lang_msg("DLG_OTHER_TITLE", uimsg, sizeof(uimsg), uitmp);
@@ -1037,7 +1037,7 @@
 //              { IDCANCEL, "BTN_CANCEL" },
             };
             HWND hWnd = (HWND)this;
-            SetDlgTexts(hWnd, text_info, _countof(text_info), UILanguageFile);
+			SetI18DlgStrs("TTProxy", hWnd, text_info, _countof(text_info), UILanguageFile);
 #if 0
             GetWindowText(uitmp, sizeof(uitmp));
             UTIL_get_lang_msgT("DLG_SETUP_TITLE", uimsg, sizeof(uimsg), uitmp);

Modified: branches/cmake/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.c
===================================================================
--- branches/cmake/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.c	2018-12-22 17:30:17 UTC (rev 7345)
+++ branches/cmake/TTXSamples/TTXRecurringCommand/TTXRecurringCommand.c	2018-12-22 17:30:33 UTC (rev 7346)
@@ -515,7 +515,8 @@
 			DlgFont = NULL;
 		}
 #endif
-		SetDlgTexts(dlg, TextInfos, _countof(TextInfos), pvar->ts->UILanguageFile);
+		SetI18DlgStrs("TTXRecurringCommand",
+					  dlg, TextInfos, _countof(TextInfos), pvar->ts->UILanguageFile);
 #if 0
 		GetWindowText(dlg, uimsg, sizeof(uimsg));
 		GetI18nStr(SECTION, "DLG_TITLE", pvar->ts->UIMsg, sizeof(pvar->ts->UIMsg), uimsg, pvar->ts->UILanguageFile);

Modified: branches/cmake/teraterm/common/dlglib.c
===================================================================
--- branches/cmake/teraterm/common/dlglib.c	2018-12-22 17:30:17 UTC (rev 7345)
+++ branches/cmake/teraterm/common/dlglib.c	2018-12-22 17:30:33 UTC (rev 7346)
@@ -128,17 +128,17 @@
 	// 20MB\x88ȏ\xE3\x82̃t\x83@\x83C\x83\x8B\x82\xF0\x83A\x83b\x83v\x83\x8D\x81[\x83h\x82\xB5\x82悤\x82Ƃ\xB7\x82\xE9\x82ƁAbuffer overflow\x82\xC5
 	// \x97\x8E\x82\xBF\x82\xE9\x96\xE2\x91\xE8\x82ւ̑Ώ\x88\x81B(2005.3.18 yutaka)
 	// cf. http://sourceforge.jp/tracker/index.php?func=detail&aid=5713&group_id=1412&atid=5333
-	double Num; 
-	TCHAR NumStr[10]; 
+	double Num;
+	TCHAR NumStr[10];
 
 	if (b==0) {
-		Num = 100.0; 
+		Num = 100.0;
 	}
 	else {
-		Num = 100.0 * (double)a / (double)b; 
+		Num = 100.0 * (double)a / (double)b;
 	}
-	_sntprintf_s(NumStr, _countof(NumStr),_TRUNCATE,_T("%3.1f%%"),Num); 
-	SetDlgItemText(HDlg, id_Item, NumStr); 
+	_sntprintf_s(NumStr, _countof(NumStr),_TRUNCATE,_T("%3.1f%%"),Num);
+	SetDlgItemText(HDlg, id_Item, NumStr);
 
 	if (id_Progress != 0 && p != NULL && *p >= 0 && (double)*p < Num) {
 		*p = (int)Num;
@@ -167,7 +167,7 @@
 
 	rate = bytes / elapsed;
 	if (rate < 1200) {
-		_sntprintf_s(buff, _countof(buff), _TRUNCATE, _T("%d:%02d (%dBytes/s)"), elapsed / 60, elapsed % 60, rate); 
+		_sntprintf_s(buff, _countof(buff), _TRUNCATE, _T("%d:%02d (%dBytes/s)"), elapsed / 60, elapsed % 60, rate);
 	}
 	else if (rate < 1200000) {
 		_sntprintf_s(buff, _countof(buff), _TRUNCATE, _T("%d:%02d (%d.%02dKB/s)"), elapsed / 60, elapsed % 60, rate / 1000, rate / 10 % 100);
@@ -374,43 +374,3 @@
 	SetWindowLongPtr(hWndEdit, GWLP_WNDPROC, (LONG_PTR)HostnameEditProc);
 	SetWindowLongPtr(hWndEdit, GWLP_USERDATA, (LONG_PTR)data);
 }
-
-void SetDlgTexts(HWND hDlgWnd, const DlgTextInfo *infos, int infoCount, const char *UILanguageFile)
-{
-	int i;
-	assert(hDlgWnd != NULL);
-	assert(infoCount > 0);
-	for (i = 0 ; i < infoCount; i++) {
-		const char *key = infos[i].key;
-		TCHAR uimsg[MAX_UIMSG];
-		get_lang_msgT(key, uimsg, sizeof(uimsg), _T(""), UILanguageFile);
-		if (uimsg[0] != _T('\0')) {
-			const int nIDDlgItem = infos[i].nIDDlgItem;
-			if (nIDDlgItem == 0) {
-				SetWindowText(hDlgWnd, uimsg);
-			} else {
-				BOOL r;
-				r = SetDlgItemText(hDlgWnd, nIDDlgItem, uimsg);
-				assert(r != 0); (void)r;
-			}
-		}
-	}
-}
-
-void SetDlgMenuTexts(HMENU hMenu, const DlgTextInfo *infos, int infoCount, const char *UILanguageFile)
-{
-	int i;
-	for (i = 0; i < infoCount; i++) {
-		const int nIDDlgItem = infos[i].nIDDlgItem;
-		const char *key = infos[i].key;
-		TCHAR uimsg[MAX_UIMSG];
-		get_lang_msgT(key, uimsg, sizeof(uimsg), _T(""), UILanguageFile);
-		if (uimsg[0] != '\0') {
-			if (nIDDlgItem < 1000) {
-				ModifyMenu(hMenu, nIDDlgItem, MF_BYPOSITION, nIDDlgItem, uimsg);
-			} else {
-				ModifyMenu(hMenu, nIDDlgItem, MF_BYCOMMAND, nIDDlgItem, uimsg);
-			}
-		}
-	}
-}

Modified: branches/cmake/teraterm/common/dlglib.h
===================================================================
--- branches/cmake/teraterm/common/dlglib.h	2018-12-22 17:30:17 UTC (rev 7345)
+++ branches/cmake/teraterm/common/dlglib.h	2018-12-22 17:30:33 UTC (rev 7346)
@@ -30,6 +30,7 @@
 #pragma once
 
 #include <windows.h>
+#include "i18n.h"
 
  /* Routines for dialog boxes */
 #ifdef __cplusplus
@@ -49,12 +50,6 @@
 LONG GetCurSel(HWND HDlg, int Id_Item);
 void InitDlgProgress(HWND HDlg, int id_Progress, int *CurProgStat);
 void SetEditboxSubclass(HWND hDlg, int nID, BOOL ComboBox);
-typedef struct {
-	int nIDDlgItem;
-	const char *key;
-} DlgTextInfo;
-void SetDlgTexts(HWND hDlgWnd, const DlgTextInfo *infos, int infoCount, const char *UILanguageFile);
-void SetDlgMenuTexts(HMENU hMenu, const DlgTextInfo *infos, int infoCount, const char *UILanguageFile);
 
 #if defined(_UNICODE)
 #define SetDropDownListT(p1, p2, p3, p4)	SetDropDownListW(p1, p2, p3, p4)

Modified: branches/cmake/teraterm/common/i18n.c
===================================================================
--- branches/cmake/teraterm/common/i18n.c	2018-12-22 17:30:17 UTC (rev 7345)
+++ branches/cmake/teraterm/common/i18n.c	2018-12-22 17:30:33 UTC (rev 7346)
@@ -27,7 +27,11 @@
  */
 
 #include "i18n.h"
+#include "ttlib.h"
 
+#include <assert.h>
+#include <tchar.h>
+
 #if defined(UNICODE)
 DllExport void GetI18nStrW(const char *section, const char *key, wchar_t *buf, int buf_len, const wchar_t *def, const char *iniFile)
 {
@@ -94,3 +98,47 @@
 
 	return TRUE;
 }
+
+DllExport
+void SetI18DlgStrs(const char *section, HWND hDlgWnd,
+				   const DlgTextInfo *infos, size_t infoCount, const char *UILanguageFile)
+{
+	size_t i;
+	assert(hDlgWnd != NULL);
+	assert(infoCount > 0);
+	for (i = 0 ; i < infoCount; i++) {
+		const char *key = infos[i].key;
+		TCHAR uimsg[MAX_UIMSG];
+		GetI18nStrT(section, key, uimsg, sizeof(uimsg), _T(""), UILanguageFile);
+		if (uimsg[0] != _T('\0')) {
+			const int nIDDlgItem = infos[i].nIDDlgItem;
+			if (nIDDlgItem == 0) {
+				SetWindowText(hDlgWnd, uimsg);
+			} else {
+				BOOL r;
+				r = SetDlgItemText(hDlgWnd, nIDDlgItem, uimsg);
+				assert(r != 0); (void)r;
+			}
+		}
+	}
+}
+
+DllExport
+void SetI18MenuStrs(const char *section, HMENU hMenu,
+					const DlgTextInfo *infos, size_t infoCount, const char *UILanguageFile)
+{
+	size_t i;
+	for (i = 0; i < infoCount; i++) {
+		const int nIDDlgItem = infos[i].nIDDlgItem;
+		const char *key = infos[i].key;
+		TCHAR uimsg[MAX_UIMSG];
+		GetI18nStrT(section, key, uimsg, sizeof(uimsg), _T(""), UILanguageFile);
+		if (uimsg[0] != '\0') {
+			if (nIDDlgItem < 1000) {
+				ModifyMenu(hMenu, nIDDlgItem, MF_BYPOSITION, nIDDlgItem, uimsg);
+			} else {
+				ModifyMenu(hMenu, nIDDlgItem, MF_BYCOMMAND, nIDDlgItem, uimsg);
+			}
+		}
+	}
+}

Modified: branches/cmake/teraterm/common/i18n.h
===================================================================
--- branches/cmake/teraterm/common/i18n.h	2018-12-22 17:30:17 UTC (rev 7345)
+++ branches/cmake/teraterm/common/i18n.h	2018-12-22 17:30:33 UTC (rev 7346)
@@ -30,7 +30,7 @@
 #define __I18N_H
 
 #include <windows.h>
-#include "ttlib.h"
+//#include "ttlib.h"
 
 #define MAX_UIMSG	1024
 
@@ -51,6 +51,11 @@
 #define DllExport	// direct link
 #endif
 
+typedef struct {
+	int nIDDlgItem;
+	const char *key;
+} DlgTextInfo;
+
 #if defined(UNICODE)
 DllExport void GetI18nStrW(const char *section, const char *key, wchar_t *buf, int buf_len, const wchar_t *def, const char *iniFile);
 #endif
@@ -57,6 +62,10 @@
 DllExport void GetI18nStr(const char *section, const char *key, PCHAR buf, int buf_len, const char *def, const char *iniFile);
 DllExport void GetI18nStrU8(const char *section, const char *key, char *buf, int buf_len, const char *def, const char *iniFile);
 DllExport int GetI18nLogfont(const char *section, const char *key, PLOGFONTA logfont, int ppi, const char *iniFile);
+DllExport void SetI18DlgStrs(const char *section, HWND hDlgWnd,
+							 const DlgTextInfo *infos, size_t infoCount, const char *UILanguageFile);
+DllExport void SetI18MenuStrs(const char *section, HMENU hMenu,
+							  const DlgTextInfo *infos, size_t infoCount, const char *UILanguageFile);
 
 #if defined(_UNICODE)
 #define	GetI18nStrT(p1, p2, p3, p4, p5, p6) GetI18nStrW(p1, p2, p3, p4, p5, p6)

Modified: branches/cmake/teraterm/common/teraterm.h
===================================================================
--- branches/cmake/teraterm/common/teraterm.h	2018-12-22 17:30:17 UTC (rev 7345)
+++ branches/cmake/teraterm/common/teraterm.h	2018-12-22 17:30:33 UTC (rev 7346)
@@ -70,6 +70,7 @@
 #define USE_NORMAL_BGCOLOR
 
 #include "i18n.h"
+#include "ttlib.h"
 
 #define MAXPATHLEN 256
 /* version 2.3 */

Modified: branches/cmake/teraterm/common/ttlib.c
===================================================================
--- branches/cmake/teraterm/common/ttlib.c	2018-12-22 17:30:17 UTC (rev 7345)
+++ branches/cmake/teraterm/common/ttlib.c	2018-12-22 17:30:33 UTC (rev 7346)
@@ -101,8 +101,6 @@
    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
 };
 
-static const char *lang_section = "Tera Term";
-
 void b64encode(PCHAR d, int dsize, PCHAR s, int len)
 {
 	unsigned int b = 0;
@@ -1014,31 +1012,26 @@
 	strncpy_s(buf, buflen, Temp, _TRUNCATE);
 }
 
-void set_lang_section(const char *section)
-{
-	lang_section = section;
-}
-
 #if defined(UNICODE)
 void get_lang_msgW(const char *key, wchar_t *buf, int buf_len, const wchar_t *def, const char *iniFile)
 {
-	GetI18nStrW(lang_section, key, buf, buf_len, def, iniFile);
+	GetI18nStrW("Tera Term", key, buf, buf_len, def, iniFile);
 }
 #endif
 
 void get_lang_msg(const char *key, PCHAR buf, int buf_len, const char *def, const char *iniFile)
 {
-	GetI18nStr(lang_section, key, buf, buf_len, def, iniFile);
+	GetI18nStr("Tera Term", key, buf, buf_len, def, iniFile);
 }
 
 void get_lang_msgU8(const char *key, PCHAR buf, int buf_len, const char *def, const char *iniFile)
 {
-	GetI18nStrU8(lang_section, key, buf, buf_len, def, iniFile);
+	GetI18nStrU8("Tera Term", key, buf, buf_len, def, iniFile);
 }
 
 int get_lang_font(PCHAR key, HWND dlg, PLOGFONTA logfont, HFONT *font, const char *iniFile)
 {
-	if (GetI18nLogfont(lang_section, key, logfont,
+	if (GetI18nLogfont("Tera Term", key, logfont,
 	                   GetDeviceCaps(GetDC(dlg),LOGPIXELSY),
 	                   iniFile) == FALSE) {
 		return FALSE;
@@ -1886,3 +1879,13 @@
 
 	return TRUE;
 }
+
+void SetDlgTexts(HWND hDlgWnd, const DlgTextInfo *infos, int infoCount, const char *UILanguageFile)
+{
+	SetI18DlgStrs("Tera Term", hDlgWnd, infos, infoCount, UILanguageFile);
+}
+
+void SetDlgMenuTexts(HMENU hMenu, const DlgTextInfo *infos, int infoCount, const char *UILanguageFile)
+{
+	SetI18MenuStrs("Tera Term", hMenu, infos, infoCount, UILanguageFile);
+}

Modified: branches/cmake/teraterm/common/ttlib.h
===================================================================
--- branches/cmake/teraterm/common/ttlib.h	2018-12-22 17:30:17 UTC (rev 7345)
+++ branches/cmake/teraterm/common/ttlib.h	2018-12-22 17:30:33 UTC (rev 7346)
@@ -31,6 +31,8 @@
 
 #pragma once
 
+#include "i18n.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -83,7 +85,6 @@
 void GetDefaultSetupFName(char *home, char *dest, int destlen);
 void GetUILanguageFile(char *buf, int buflen);
 void GetOnOffEntryInifile(char *entry, char *buf, int buflen);
-DllExport void set_lang_section(const char *section);
 DllExport void get_lang_msg(const char *key, PCHAR buf, int buf_len, const char *def, const char *iniFile);
 DllExport void get_lang_msgU8(const char *key, PCHAR buf, int buf_len, const char *def, const char *iniFile);
 #if defined(UNICODE)
@@ -127,11 +128,14 @@
 
 #define CheckFlag(var, flag)	(((var) & (flag)) != 0)
 
+void SetDlgTexts(HWND hDlgWnd, const DlgTextInfo *infos, int infoCount, const char *UILanguageFile);
+void SetDlgMenuTexts(HMENU hMenu, const DlgTextInfo *infos, int infoCount, const char *UILanguageFile);
+
 #if defined(_UNICODE)
-#define doSelectFolderT(p1, p2, p3, p4, p5) doSelectFolderW(p1, p2, p3, p4, p5)
+#define	doSelectFolderT(p1, p2, p3, p4, p5) doSelectFolderW(p1, p2, p3, p4, p5)
 #define	get_lang_msgT(p1, p2, p3, p4, p5) get_lang_msgW(p1, p2, p3, p4, p5)
 #else
-#define doSelectFolderT(p1, p2, p3, p4, p5) doSelectFolder(p1, p2, p3, p4, p5)
+#define	doSelectFolderT(p1, p2, p3, p4, p5) doSelectFolder(p1, p2, p3, p4, p5)
 #define	get_lang_msgT(p1, p2, p3, p4, p5) get_lang_msg(p1, p2, p3, p4, p5)
 #endif
 

Modified: branches/cmake/ttpmenu/CMakeLists.txt
===================================================================
--- branches/cmake/ttpmenu/CMakeLists.txt	2018-12-22 17:30:17 UTC (rev 7345)
+++ branches/cmake/ttpmenu/CMakeLists.txt	2018-12-22 17:30:33 UTC (rev 7346)
@@ -19,12 +19,14 @@
 set(SRC
   resource.h
   registry.cpp
+  winmisc.cpp
+  ttpmenu.h
   ttpmenu.cpp
-  winmisc.cpp
+  #
+  ttpmenu.rc
   left.ico
   right.ico
   teraterm.ico
-  ttpmenu.rc
   )
 
 

Modified: branches/cmake/ttpmenu/ttpmenu.cpp
===================================================================
--- branches/cmake/ttpmenu/ttpmenu.cpp	2018-12-22 17:30:17 UTC (rev 7345)
+++ branches/cmake/ttpmenu/ttpmenu.cpp	2018-12-22 17:30:33 UTC (rev 7346)
@@ -17,7 +17,8 @@
 #include	"winmisc.h"
 #include	"resource.h"
 
-#include "compat_w95.h"
+#include	"compat_w95.h"
+#include	"ttlib.h"
 
 // UTF-8 TeraTerm\x82ł́A\x83f\x83t\x83H\x83\x8B\x83g\x83C\x83\x93\x83X\x83g\x81[\x83\x8B\x90\xE6\x82\xF0\x89\xBA\x8BL\x82ɕύX\x82\xB5\x82\xBD\x81B(2004.12.2 yutaka)
 // \x82\xB3\x82\xE7\x82ɁA\x83f\x83t\x83H\x83\x8B\x83g\x83C\x83\x93\x83X\x83g\x81[\x83\x8B\x90\xE6\x82̓J\x83\x8C\x83\x93\x83g\x83f\x83B\x83\x8C\x83N\x83g\x83\x8A\x82ɕύX\x81B(2004.12.14 yutaka)

Modified: branches/cmake/ttssh2/ttxssh/auth.c
===================================================================
--- branches/cmake/ttssh2/ttxssh/auth.c	2018-12-22 17:30:17 UTC (rev 7345)
+++ branches/cmake/ttssh2/ttxssh/auth.c	2018-12-22 17:30:33 UTC (rev 7346)
@@ -233,7 +233,7 @@
 	TCHAR uimsg[MAX_UIMSG];
 	int default_method = pvar->session_settings.DefaultAuthMethod;
 
-	SetDlgTexts(dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
+	SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 #if 0
 	GetWindowText(dlg, uimsg, _countof(uimsg));
 	UTIL_get_lang_msgT("DLG_AUTH_TITLE", pvar, uimsg);
@@ -1164,7 +1164,7 @@
 		{ IDOK, "BTN_OK" },
 		{ IDCANCEL, "BTN_DISCONNECT" },
 	};
-	SetDlgTexts(dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
+	SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 #if 0
 	GetWindowText(dlg, uimsg, sizeof(uimsg));
 	UTIL_get_lang_msg("DLG_TIS_TITLE", pvar, uimsg);
@@ -1331,7 +1331,7 @@
 		{ IDOK, "BTN_OK" },
 		{ IDCANCEL, "BTN_CANCEL" },
 	};
-	SetDlgTexts(dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
+	SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 #if 0
 	GetWindowText(dlg, uimsg, sizeof(uimsg));
 	UTIL_get_lang_msg("DLG_AUTHSETUP_TITLE", pvar, uimsg);

Modified: branches/cmake/ttssh2/ttxssh/fwdui.c
===================================================================
--- branches/cmake/ttssh2/ttxssh/fwdui.c	2018-12-22 17:30:17 UTC (rev 7345)
+++ branches/cmake/ttssh2/ttxssh/fwdui.c	2018-12-22 17:30:33 UTC (rev 7346)
@@ -527,7 +527,7 @@
 		{ IDOK, "BTN_OK" },
 		{ IDCANCEL, "BTN_CANCEL" },
 	};
-	SetDlgTexts(dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
+	SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 #if 0
 	GetWindowText(dlg, uimsg, sizeof(uimsg));
 	UTIL_get_lang_msg("DLG_FWD_TITLE", pvar, uimsg);
@@ -846,7 +846,7 @@
 		{ IDOK, "BTN_OK" },
 		{ IDCANCEL, "BTN_CANCEL" },
 	};
-	SetDlgTexts(dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
+	SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 
 #if 0
 	GetWindowText(dlg, uimsg, sizeof(uimsg));

Modified: branches/cmake/ttssh2/ttxssh/hosts.c
===================================================================
--- branches/cmake/ttssh2/ttxssh/hosts.c	2018-12-22 17:30:17 UTC (rev 7345)
+++ branches/cmake/ttssh2/ttxssh/hosts.c	2018-12-22 17:30:33 UTC (rev 7346)
@@ -1773,7 +1773,7 @@
 		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		// \x92lj\xC1\x81E\x92u\x82\xAB\x8A\xB7\x82\xA6\x82Ƃ\xE0 init_hosts_dlg \x82\xF0\x8CĂ\xF1\x82ł\xA2\x82\xE9\x82̂ŁA\x82\xBB\x82̑O\x82ɃZ\x83b\x83g\x82\xB7\x82\xE9\x95K\x97v\x82\xAA\x82\xA0\x82\xE9
-		SetDlgTexts(dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
+		SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 #if 0
 		GetWindowText(dlg, uimsg, sizeof(uimsg));
 		UTIL_get_lang_msg("DLG_UNKNOWNHOST_TITLE", pvar, uimsg);
@@ -1963,7 +1963,7 @@
 		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		// \x92lj\xC1\x81E\x92u\x82\xAB\x8A\xB7\x82\xA6\x82Ƃ\xE0 init_hosts_dlg \x82\xF0\x8CĂ\xF1\x82ł\xA2\x82\xE9\x82̂ŁA\x82\xBB\x82̑O\x82ɃZ\x83b\x83g\x82\xB7\x82\xE9\x95K\x97v\x82\xAA\x82\xA0\x82\xE9
-		SetDlgTexts(dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
+		SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 #if 0
 		GetWindowText(dlg, uimsg, sizeof(uimsg));
 		UTIL_get_lang_msg("DLG_DIFFERENTKEY_TITLE", pvar, uimsg);
@@ -2151,7 +2151,7 @@
 		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
 		// \x92lj\xC1\x81E\x92u\x82\xAB\x8A\xB7\x82\xA6\x82Ƃ\xE0 init_hosts_dlg \x82\xF0\x8CĂ\xF1\x82ł\xA2\x82\xE9\x82̂ŁA\x82\xBB\x82̑O\x82ɃZ\x83b\x83g\x82\xB7\x82\xE9\x95K\x97v\x82\xAA\x82\xA0\x82\xE9
-		SetDlgTexts(dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
+		SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 #if 0
 		GetWindowText(dlg, uimsg, sizeof(uimsg));
 		UTIL_get_lang_msg("DLG_DIFFERENTTYPEKEY_TITLE", pvar, uimsg);

Modified: branches/cmake/ttssh2/ttxssh/ssh.c
===================================================================
--- branches/cmake/ttssh2/ttxssh/ssh.c	2018-12-22 17:30:17 UTC (rev 7345)
+++ branches/cmake/ttssh2/ttxssh/ssh.c	2018-12-22 17:30:33 UTC (rev 7346)
@@ -7498,7 +7498,7 @@
 			DlgChgPassFont = NULL;
 		}
 #endif
-		SetDlgTexts(dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
+		SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 #if 0
 		GetWindowText(dlg, uimsg, sizeof(uimsg));
 		UTIL_get_lang_msg("DLG_PASSCHG_TITLE", pvar, uimsg)

Modified: branches/cmake/ttssh2/ttxssh/ttxssh.c
===================================================================
--- branches/cmake/ttssh2/ttxssh/ttxssh.c	2018-12-22 17:30:17 UTC (rev 7345)
+++ branches/cmake/ttssh2/ttxssh/ttxssh.c	2018-12-22 17:30:33 UTC (rev 7346)
@@ -1355,7 +1355,7 @@
 		GetHNRec = (PGetHNRec) lParam;
 		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
-		SetDlgTexts(dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
+		SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 
 #if 0
 		GetWindowText(dlg, uimsg, sizeof(uimsg));
@@ -2487,7 +2487,7 @@
 		{ IDC_FP_HASH_ALG, "DLG_ABOUT_FP_HASH_ALGORITHM" },
 		{ IDOK, "BTN_OK" },
 	};
-	SetDlgTexts(dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
+	SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 #if 0
 	GetWindowText(dlg, uimsg, sizeof(uimsg));
 	UTIL_get_lang_msg("DLG_ABOUT_TITLE", pvar, uimsg);
@@ -2834,7 +2834,7 @@
 
 		{ IDC_HOSTKEY_ROTATION_STATIC, "DLG_SSHSETUP_HOSTKEY_ROTATION" },
 	};
-	SetDlgTexts(dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
+	SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 
 #if 0
 	GetWindowText(dlg, uimsg, sizeof(uimsg));
@@ -4521,7 +4521,7 @@
 				{ IDC_BCRYPT_KDF_CHECK, "DLG_KEYGEN_BCRYPT_KDF" },
 				{ IDC_BCRYPT_KDF_ROUNDS_LABEL, "DLG_KEYGEN_BCRYPT_ROUNDS" },
 			};
-			SetDlgTexts(dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
+			SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 #if 0
 			GetWindowText(dlg, uimsg, sizeof(uimsg));
 			UTIL_get_lang_msg("DLG_KEYGEN_TITLE", pvar, uimsg);
@@ -5730,7 +5730,6 @@
 #endif
 		DoCover_IsDebuggerPresent();
 		DisableThreadLibraryCalls(hInstance);
-		set_lang_section("TTSSH");
 		hInst = hInstance;
 		pvar = &InstVar;
 		__mem_mapping =

Modified: branches/cmake/ttssh2/ttxssh/util.c
===================================================================
--- branches/cmake/ttssh2/ttxssh/util.c	2018-12-22 17:30:17 UTC (rev 7345)
+++ branches/cmake/ttssh2/ttxssh/util.c	2018-12-22 17:30:33 UTC (rev 7346)
@@ -316,18 +316,18 @@
 
 void UTIL_get_lang_msgA(const char *key, char *buf, size_t buf_len, const char *def, const char *iniFile)
 {
-	get_lang_msg(key, buf, buf_len, def, iniFile);
+	GetI18nStr("TTSSH", key, buf, buf_len, def, iniFile);
 }
 
 void UTIL_get_lang_msgU8(const char *key, char *buf, size_t buf_len, const char *def, const char *iniFile)
 {
-	get_lang_msgU8(key, buf, buf_len, def, iniFile);
+	GetI18nStrU8("TTSSH", key, buf, buf_len, def, iniFile);
 }
 
 #if defined(_UNICODE)
 void UTIL_get_lang_msgW(const char *key, wchar_t *buf, size_t buf_len, const wchar_t *def, const char *iniFile)
 {
-	get_lang_msgW(key, buf, buf_len, def, iniFile);
+	GetI18nStrW("TTSSH", key, buf, buf_len, def, iniFile);
 }
 #endif
 


Ttssh2-commit メーリングリストの案内
Back to archive index