[Ttssh2-commit] [8240] ttssh2でSetI18DlgStrs()を使用するようにした

scmno****@osdn***** scmno****@osdn*****
2019年 10月 2日 (水) 23:00:05 JST


Revision: 8240
          https://osdn.net/projects/ttssh2/scm/svn/commits/8240
Author:   zmatsuo
Date:     2019-10-02 23:00:04 +0900 (Wed, 02 Oct 2019)
Log Message:
-----------
ttssh2でSetI18DlgStrs()を使用するようにした

Modified Paths:
--------------
    trunk/ttssh2/ttxssh/auth.c
    trunk/ttssh2/ttxssh/fwdui.c
    trunk/ttssh2/ttxssh/hosts.c
    trunk/ttssh2/ttxssh/ttxssh.c

-------------- next part --------------
Modified: trunk/ttssh2/ttxssh/auth.c
===================================================================
--- trunk/ttssh2/ttxssh/auth.c	2019-10-02 08:38:43 UTC (rev 8239)
+++ trunk/ttssh2/ttxssh/auth.c	2019-10-02 14:00:04 UTC (rev 8240)
@@ -1343,21 +1343,14 @@
 
 static void init_TIS_dlg(PTInstVar pvar, HWND dlg)
 {
-	char uimsg[MAX_UIMSG];
+	const static DlgTextInfo text_info[] = {
+		{ 0, "DLG_TIS_TITLE" },
+		{ IDC_SSHAUTHBANNER, "DLG_TIS_BANNER" },
+		{ IDOK, "BTN_OK" },
+		{ IDCANCEL, "BTN_DISCONNECT" },
+	};
+	SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 
-	GetWindowText(dlg, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_TIS_TITLE", pvar, uimsg);
-	SetWindowText(dlg, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHAUTHBANNER, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_TIS_BANNER", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHAUTHBANNER, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDOK, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("BTN_OK", pvar, uimsg);
-	SetDlgItemText(dlg, IDOK, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDCANCEL, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("BTN_DISCONNECT", pvar, uimsg);
-	SetDlgItemText(dlg, IDCANCEL, pvar->ts->UIMsg);
-
 	init_auth_machine_banner(pvar, dlg);
 	init_password_control(pvar, dlg, IDC_SSHPASSWORD, NULL);
 

Modified: trunk/ttssh2/ttxssh/fwdui.c
===================================================================
--- trunk/ttssh2/ttxssh/fwdui.c	2019-10-02 08:38:43 UTC (rev 8239)
+++ trunk/ttssh2/ttxssh/fwdui.c	2019-10-02 14:00:04 UTC (rev 8240)
@@ -498,39 +498,20 @@
 	FWDRequestSpec *requests =
 		(FWDRequestSpec *) malloc(sizeof(FWDRequestSpec) * num_specs);
 	int i;
-	char uimsg[MAX_UIMSG];
+	const static DlgTextInfo text_info[] = {
+		{ 0, "DLG_FWD_TITLE" },
+		{ IDC_PORTFORWARD, "DLG_FWDSETUP_LIST" },
+		{ IDC_ADD, "DLG_FWDSETUP_ADD" },
+		{ IDC_EDIT, "DLG_FWDSETUP_EDIT" },
+		{ IDC_REMOVE, "DLG_FWDSETUP_REMOVE" },
+		{ IDC_XFORWARD, "DLG_FWDSETUP_X" },
+		{ IDC_SSHFWDX11, "DLG_FWDSETUP_XAPP" },
+		{ IDOK, "BTN_OK" },
+		{ IDCANCEL, "BTN_CANCEL" },
+		{ IDC_SSHFWDSETUP_HELP, "BTN_HELP" },
+	};
+	SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 
-	GetWindowText(dlg, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_FWD_TITLE", pvar, uimsg);
-	SetWindowText(dlg, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_PORTFORWARD, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_FWDSETUP_LIST", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_PORTFORWARD, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_ADD, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_FWDSETUP_ADD", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_ADD, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_EDIT, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_FWDSETUP_EDIT", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_EDIT, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_REMOVE, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_FWDSETUP_REMOVE", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_REMOVE, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_XFORWARD, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_FWDSETUP_X", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_XFORWARD, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHFWDX11, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_FWDSETUP_XAPP", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHFWDX11, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDOK, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("BTN_OK", pvar, uimsg);
-	SetDlgItemText(dlg, IDOK, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDCANCEL, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("BTN_CANCEL", pvar, uimsg);
-	SetDlgItemText(dlg, IDCANCEL, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHFWDSETUP_HELP, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("BTN_HELP", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHFWDSETUP_HELP, pvar->ts->UIMsg);
-
 	FWD_get_request_specs(pvar, requests, num_specs);
 
 	for (i = 0; i < num_specs; i++) {
@@ -804,51 +785,24 @@
 
 static void init_fwd_edit_dlg(PTInstVar pvar, FWDRequestSpec *spec, HWND dlg)
 {
-	char uimsg[MAX_UIMSG];
+	const static DlgTextInfo text_info[] = {
+		{ 0, "DLG_FWD_TITLE" },
+		{ IDD_SSHFWDBANNER, "DLG_FWD_BANNER" },
+		{ IDC_SSHFWDLOCALTOREMOTE, "DLG_FWD_LOCAL_PORT" },
+		{ IDC_SSHFWDLOCALTOREMOTE_LISTEN, "DLG_FWD_LOCAL_LISTEN" },
+		{ IDC_SSHFWDLOCALTOREMOTE_HOST, "DLG_FWD_LOCAL_REMOTE" },
+		{ IDC_SSHFWDLOCALTOREMOTE_PORT, "DLG_FWD_LOCAL_REMOTE_PORT" },
+		{ IDC_SSHFWDREMOTETOLOCAL, "DLG_FWD_REMOTE_PORT" },
+		{ IDC_SSHFWDREMOTETOLOCAL_LISTEN, "DLG_FWD_REMOTE_LISTEN" },
+		{ IDC_SSHFWDREMOTETOLOCAL_HOST, "DLG_FWD_REMOTE_LOCAL" },
+		{ IDC_SSHFWDREMOTETOLOCAL_PORT, "DLG_FWD_REMOTE_LOCAL_PORT" },
+		{ IDC_SSHFWDLOCALDYNAMIC, "DLG_FWD_DYNAMIC_PORT" },
+		{ IDC_SSHFWDLOCALDYNAMIC_LISTEN, "DLG_FWD_DYNAMIC_LISTEN" },
+		{ IDOK, "BTN_OK" },
+		{ IDCANCEL, "BTN_CANCEL" },
+	};
+	SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 
-	GetWindowText(dlg, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_FWD_TITLE", pvar, uimsg);
-	SetWindowText(dlg, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDD_SSHFWDBANNER, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_FWD_BANNER", pvar, uimsg);
-	SetDlgItemText(dlg, IDD_SSHFWDBANNER, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHFWDLOCALTOREMOTE, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_FWD_LOCAL_PORT", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHFWDLOCALTOREMOTE, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHFWDLOCALTOREMOTE_LISTEN, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_FWD_LOCAL_LISTEN", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHFWDLOCALTOREMOTE_LISTEN, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHFWDLOCALTOREMOTE_HOST, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_FWD_LOCAL_REMOTE", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHFWDLOCALTOREMOTE_HOST, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHFWDLOCALTOREMOTE_PORT, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_FWD_LOCAL_REMOTE_PORT", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHFWDLOCALTOREMOTE_PORT, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHFWDREMOTETOLOCAL, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_FWD_REMOTE_PORT", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHFWDREMOTETOLOCAL, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHFWDREMOTETOLOCAL_LISTEN, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_FWD_REMOTE_LISTEN", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHFWDREMOTETOLOCAL_LISTEN, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHFWDREMOTETOLOCAL_HOST, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_FWD_REMOTE_LOCAL", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHFWDREMOTETOLOCAL_HOST, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHFWDREMOTETOLOCAL_PORT, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_FWD_REMOTE_LOCAL_PORT", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHFWDREMOTETOLOCAL_PORT, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHFWDLOCALDYNAMIC, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_FWD_DYNAMIC_PORT", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHFWDLOCALDYNAMIC, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHFWDLOCALDYNAMIC_LISTEN, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_FWD_DYNAMIC_LISTEN", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHFWDLOCALDYNAMIC_LISTEN, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDOK, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("BTN_OK", pvar, uimsg);
-	SetDlgItemText(dlg, IDOK, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDCANCEL, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("BTN_CANCEL", pvar, uimsg);
-	SetDlgItemText(dlg, IDCANCEL, pvar->ts->UIMsg);
-
 	switch (spec->type) {
 	case FWD_REMOTE_TO_LOCAL:
 		setup_edit_controls(dlg, spec, IDC_SSHFWDREMOTETOLOCAL,

Modified: trunk/ttssh2/ttxssh/hosts.c
===================================================================
--- trunk/ttssh2/ttxssh/hosts.c	2019-10-02 08:38:43 UTC (rev 8239)
+++ trunk/ttssh2/ttxssh/hosts.c	2019-10-02 14:00:04 UTC (rev 8240)
@@ -1726,8 +1726,17 @@
 static INT_PTR CALLBACK hosts_add_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
 										   LPARAM lParam)
 {
+	const static DlgTextInfo text_info[] = {
+		{ 0, "DLG_UNKNOWNHOST_TITLE" },
+		{ IDC_HOSTWARNING, "DLG_UNKNOWNHOST_WARNING" },
+		{ IDC_HOSTWARNING2, "DLG_UNKNOWNHOST_WARNING2" },
+		{ IDC_HOSTFINGERPRINT, "DLG_UNKNOWNHOST_FINGERPRINT" },
+		{ IDC_FP_HASH_ALG, "DLG_UNKNOWNHOST_FP_HASH_ALGORITHM" },
+		{ IDC_ADDTOKNOWNHOSTS, "DLG_UNKNOWNHOST_ADD" },
+		{ IDC_CONTINUE, "BTN_CONTINUE" },
+		{ IDCANCEL, "BTN_DISCONNECT" },
+	};
 	PTInstVar pvar;
-	char uimsg[MAX_UIMSG];
 
 	switch (msg) {
 	case WM_INITDIALOG:
@@ -1736,30 +1745,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
-		GetWindowText(dlg, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_UNKNOWNHOST_TITLE", pvar, uimsg);
-		SetWindowText(dlg, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_HOSTWARNING, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_UNKNOWNHOST_WARNING", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_HOSTWARNING, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_HOSTWARNING2, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_UNKNOWNHOST_WARNING2", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_HOSTWARNING2, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_HOSTFINGERPRINT, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_UNKNOWNHOST_FINGERPRINT", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_HOSTFINGERPRINT, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_FP_HASH_ALG, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_UNKNOWNHOST_FP_HASH_ALGORITHM", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_FP_HASH_ALG, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_ADDTOKNOWNHOSTS, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_UNKNOWNHOST_ADD", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_ADDTOKNOWNHOSTS, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_CONTINUE, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("BTN_CONTINUE", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_CONTINUE, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDCANCEL, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("BTN_DISCONNECT", pvar, uimsg);
-		SetDlgItemText(dlg, IDCANCEL, pvar->ts->UIMsg);
+		SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 
 		switch (pvar->dns_key_check) {
 		case DNS_VERIFY_NOTFOUND:
@@ -1897,8 +1883,17 @@
 static INT_PTR CALLBACK hosts_replace_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
 											   LPARAM lParam)
 {
+	const static DlgTextInfo text_info[] = {
+		{ 0, "DLG_UNKNOWNHOST_TITLE" },
+		{ IDC_HOSTWARNING, "DLG_DIFFERENTKEY_WARNING" },
+		{ IDC_HOSTWARNING2, "DLG_DIFFERENTKEY_WARNING2" },
+		{ IDC_HOSTFINGERPRINT, "DLG_DIFFERENTKEY_FINGERPRINT" },
+		{ IDC_FP_HASH_ALG, "DLG_DIFFERENTKEY_FP_HASH_ALGORITHM" },
+		{ IDC_ADDTOKNOWNHOSTS, "DLG_DIFFERENTKEY_REPLACE" },
+		{ IDC_CONTINUE, "BTN_CONTINUE" },
+		{ IDCANCEL, "BTN_DISCONNECT" },
+	};
 	PTInstVar pvar;
-	char uimsg[MAX_UIMSG];
 
 	switch (msg) {
 	case WM_INITDIALOG:
@@ -1907,30 +1902,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
-		GetWindowText(dlg, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_DIFFERENTKEY_TITLE", pvar, uimsg);
-		SetWindowText(dlg, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_HOSTWARNING, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_DIFFERENTKEY_WARNING", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_HOSTWARNING, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_HOSTWARNING2, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_DIFFERENTKEY_WARNING2", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_HOSTWARNING2, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_HOSTFINGERPRINT, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_DIFFERENTKEY_FINGERPRINT", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_HOSTFINGERPRINT, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_FP_HASH_ALG, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_DIFFERENTKEY_FP_HASH_ALGORITHM", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_FP_HASH_ALG, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_ADDTOKNOWNHOSTS, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_DIFFERENTKEY_REPLACE", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_ADDTOKNOWNHOSTS, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_CONTINUE, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("BTN_CONTINUE", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_CONTINUE, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDCANCEL, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("BTN_DISCONNECT", pvar, uimsg);
-		SetDlgItemText(dlg, IDCANCEL, pvar->ts->UIMsg);
+		SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 
 		switch (pvar->dns_key_check) {
 		case DNS_VERIFY_NOTFOUND:
@@ -2066,8 +2038,17 @@
 static INT_PTR CALLBACK hosts_add2_dlg_proc(HWND dlg, UINT msg, WPARAM wParam,
 											LPARAM lParam)
 {
+	const static DlgTextInfo text_info[] = {
+		{ 0, "DLG_DIFFERENTTYPEKEY_TITLE" },
+		{ IDC_HOSTWARNING, "DLG_DIFFERENTTYPEKEY_WARNING" },
+		{ IDC_HOSTWARNING2, "DLG_DIFFERENTTYPEKEY_WARNING2" },
+		{ IDC_HOSTFINGERPRINT, "DLG_DIFFERENTTYPEKEY_FINGERPRINT" },
+		{ IDC_FP_HASH_ALG, "DLG_DIFFERENTTYPEKEY_FP_HASH_ALGORITHM" },
+		{ IDC_ADDTOKNOWNHOSTS, "DLG_DIFFERENTTYPEKEY_ADD" },
+		{ IDC_CONTINUE, "BTN_CONTINUE" },
+		{ IDCANCEL, "BTN_DISCONNECT" },
+	};
 	PTInstVar pvar;
-	char uimsg[MAX_UIMSG];
 
 	switch (msg) {
 	case WM_INITDIALOG:
@@ -2076,30 +2057,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
-		GetWindowText(dlg, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_DIFFERENTTYPEKEY_TITLE", pvar, uimsg);
-		SetWindowText(dlg, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_HOSTWARNING, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_DIFFERENTTYPEKEY_WARNING", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_HOSTWARNING, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_HOSTWARNING2, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_DIFFERENTTYPEKEY_WARNING2", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_HOSTWARNING2, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_HOSTFINGERPRINT, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_DIFFERENTTYPEKEY_FINGERPRINT", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_HOSTFINGERPRINT, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_FP_HASH_ALG, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_DIFFERENTTYPEKEY_FP_HASH_ALGORITHM", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_FP_HASH_ALG, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_ADDTOKNOWNHOSTS, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_DIFFERENTTYPEKEY_ADD", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_ADDTOKNOWNHOSTS, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_CONTINUE, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("BTN_CONTINUE", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_CONTINUE, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDCANCEL, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("BTN_DISCONNECT", pvar, uimsg);
-		SetDlgItemText(dlg, IDCANCEL, pvar->ts->UIMsg);
+		SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 
 		switch (pvar->dns_key_check) {
 		case DNS_VERIFY_NOTFOUND:

Modified: trunk/ttssh2/ttxssh/ttxssh.c
===================================================================
--- trunk/ttssh2/ttxssh/ttxssh.c	2019-10-02 08:38:43 UTC (rev 8239)
+++ trunk/ttssh2/ttxssh/ttxssh.c	2019-10-02 14:00:04 UTC (rev 8240)
@@ -1285,6 +1285,21 @@
 static INT_PTR CALLBACK TTXHostDlg(HWND dlg, UINT msg, WPARAM wParam,
 								   LPARAM lParam)
 {
+	const static DlgTextInfo text_info[] = {
+		{ 0, "DLG_HOST_TITLE" },
+		{ IDC_HOSTNAMELABEL, "DLG_HOST_TCPIPHOST" },
+		{ IDC_HISTORY, "DLG_HOST_TCPIPHISTORY" },
+		{ IDC_SERVICELABEL, "DLG_HOST_TCPIPSERVICE" },
+		{ IDC_HOSTOTHER, "DLG_HOST_TCPIPOTHER" },
+		{ IDC_HOSTTCPPORTLABEL, "DLG_HOST_TCPIPPORT" },
+		{ IDC_SSH_VERSION_LABEL, "DLG_HOST_TCPIPSSHVERSION" },
+		{ IDC_HOSTTCPPROTOCOLLABEL, "DLG_HOST_TCPIPPROTOCOL" },
+		{ IDC_HOSTSERIAL, "DLG_HOST_SERIAL" },
+		{ IDC_HOSTCOMLABEL, "DLG_HOST_SERIALPORT" },
+		{ IDC_HOSTHELP, "DLG_HOST_HELP" },
+		{ IDOK, "BTN_OK" },
+		{ IDCANCEL, "BTN_CANCEL" },
+	};
 	static char *ssh_version[] = {"SSH1", "SSH2", NULL};
 	PGetHNRec GetHNRec;
 	char EntName[128];
@@ -1294,7 +1309,6 @@
 	static char *ComPortDesc[MAXCOMPORT];
 	int comports;
 	BOOL Ok;
-	char uimsg[MAX_UIMSG];
 	static HWND hwndHostname     = NULL; // HOSTNAME dropdown
 	static HWND hwndHostnameEdit = NULL; // Edit control on HOSTNAME dropdown
 
@@ -1303,45 +1317,7 @@
 		GetHNRec = (PGetHNRec) lParam;
 		SetWindowLongPtr(dlg, DWLP_USER, lParam);
 
-		GetWindowText(dlg, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_HOST_TITLE", pvar, uimsg);
-		SetWindowText(dlg, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_HOSTNAMELABEL, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_HOST_TCPIPHOST", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_HOSTNAMELABEL, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_HISTORY, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_HOST_TCPIPHISTORY", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_HISTORY, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_SERVICELABEL, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_HOST_TCPIPSERVICE", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_SERVICELABEL, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_HOSTOTHER, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_HOST_TCPIPOTHER", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_HOSTOTHER, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_HOSTTCPPORTLABEL, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_HOST_TCPIPPORT", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_HOSTTCPPORTLABEL, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_SSH_VERSION_LABEL, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_HOST_TCPIPSSHVERSION", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_SSH_VERSION_LABEL, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_HOSTTCPPROTOCOLLABEL, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_HOST_TCPIPPROTOCOL", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_HOSTTCPPROTOCOLLABEL, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_HOSTSERIAL, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_HOST_SERIAL", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_HOSTSERIAL, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_HOSTCOMLABEL, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_HOST_SERIALPORT", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_HOSTCOMLABEL, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_HOSTHELP, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_HOST_HELP", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_HOSTHELP, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDOK, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("BTN_OK", pvar, uimsg);
-		SetDlgItemText(dlg, IDOK, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDCANCEL, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("BTN_CANCEL", pvar, uimsg);
-		SetDlgItemText(dlg, IDCANCEL, pvar->ts->UIMsg);
+		SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 
 		// \x83z\x83X\x83g\x83q\x83X\x83g\x83\x8A\x82̃`\x83F\x83b\x83N\x83{\x83b\x83N\x83X\x82\xF0\x92lj\xC1 (2005.10.21 yutaka)
 		if (pvar->ts->HistoryList > 0) {
@@ -2386,18 +2362,13 @@
 static void init_about_dlg(PTInstVar pvar, HWND dlg)
 {
 	char buf[1024];
-	char uimsg[MAX_UIMSG];
+	const static DlgTextInfo text_info[] = {
+		{ 0, "DLG_ABOUT_TITLE" },
+		{ IDC_FP_HASH_ALG, "DLG_ABOUT_FP_HASH_ALGORITHM" },
+		{ IDOK, "BTN_OK" },
+	};
+	SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 
-	GetWindowText(dlg, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_ABOUT_TITLE", pvar, uimsg);
-	SetWindowText(dlg, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_FP_HASH_ALG, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_ABOUT_FP_HASH_ALGORITHM", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_FP_HASH_ALG, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDOK, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("BTN_OK", pvar, uimsg);
-	SetDlgItemText(dlg, IDOK, pvar->ts->UIMsg);
-
 	// TTSSH\x82̃o\x81[\x83W\x83\x87\x83\x93\x82\xF0\x90ݒ肷\x82\xE9 (2005.2.28 yutaka)
 	_snprintf_s(buf, sizeof(buf), _TRUNCATE,
 	            "TTSSH\r\nTera Term Secure Shell extension, %d.%d\r\nCompatible with SSH protocol version 1.5 and 2.0", TTSSH_VERSION_MAJOR, TTSSH_VERSION_MINOR);
@@ -2642,139 +2613,65 @@
 	HWND hostkeyRotationControlList = GetDlgItem(dlg, IDC_HOSTKEY_ROTATION_COMBO);
 	int i;
 	int ch;
-	char uimsg[MAX_UIMSG];
-	char *rotationItem[SSH_UPDATE_HOSTKEYS_MAX] = {
+	static const char *rotationItem[SSH_UPDATE_HOSTKEYS_MAX] = {
 		"No",
 		"Yes",
 		"Ask",
 	};
-	char *rotationItemKey[SSH_UPDATE_HOSTKEYS_MAX] = {
+	static const char *rotationItemKey[SSH_UPDATE_HOSTKEYS_MAX] = {
 		"DLG_SSHSETUP_HOSTKEY_ROTATION_NO",
 		"DLG_SSHSETUP_HOSTKEY_ROTATION_YES",
 		"DLG_SSHSETUP_HOSTKEY_ROTATION_ASK",
 	};
 
-	GetWindowText(dlg, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_TITLE", pvar, uimsg);
-	SetWindowText(dlg, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_COMPRESSLABEL, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_COMPRESS", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_COMPRESSLABEL, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_COMPRESSNONE, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_COMPRESS_NONE", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_COMPRESSNONE, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_COMPRESSHIGH, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_COMPRESS_HIGHEST", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_COMPRESSHIGH, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_COMPRESSNOTE, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_COMPRESS_NOTE", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_COMPRESSNOTE, pvar->ts->UIMsg);
+	const static DlgTextInfo text_info[] = {
+		{ 0, "DLG_SSHSETUP_TITLE" },
+		{ IDC_COMPRESSLABEL, "DLG_SSHSETUP_COMPRESS" },
+		{ IDC_COMPRESSNONE, "DLG_SSHSETUP_COMPRESS_NONE" },
+		{ IDC_COMPRESSHIGH, "DLG_SSHSETUP_COMPRESS_HIGHEST" },
+		{ IDC_COMPRESSNOTE, "DLG_SSHSETUP_COMPRESS_NOTE" },
 
-	GetDlgItemText(dlg, IDC_CIPHERORDER, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_CIPHER", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_CIPHERORDER, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHMOVECIPHERUP, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_CIPHER_UP", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHMOVECIPHERUP, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHMOVECIPHERDOWN, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_CIPHER_DOWN", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHMOVECIPHERDOWN, pvar->ts->UIMsg);
+		{ IDC_CIPHERORDER, "DLG_SSHSETUP_CIPHER" },
+		{ IDC_SSHMOVECIPHERUP, "DLG_SSHSETUP_CIPHER_UP" },
+		{ IDC_SSHMOVECIPHERDOWN, "DLG_SSHSETUP_CIPHER_DOWN" },
 
-	GetDlgItemText(dlg, IDC_KEX_ORDER, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_KEX", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_KEX_ORDER, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHKEX_MOVEUP, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_KEX_UP", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHKEX_MOVEUP, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHKEX_MOVEDOWN, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_KEX_DOWN", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHKEX_MOVEDOWN, pvar->ts->UIMsg);
+		{ IDC_KEX_ORDER, "DLG_SSHSETUP_KEX" },
+		{ IDC_SSHKEX_MOVEUP, "DLG_SSHSETUP_KEX_UP" },
+		{ IDC_SSHKEX_MOVEDOWN, "DLG_SSHSETUP_KEX_DOWN" },
 
-	GetDlgItemText(dlg, IDC_HOST_KEY_ORDER, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_HOST_KEY", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_HOST_KEY_ORDER, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHHOST_KEY_MOVEUP, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_HOST_KEY_UP", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHHOST_KEY_MOVEUP, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHHOST_KEY_MOVEDOWN, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_HOST_KEY_DOWN", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHHOST_KEY_MOVEDOWN, pvar->ts->UIMsg);
+		{ IDC_HOST_KEY_ORDER, "DLG_SSHSETUP_HOST_KEY" },
+		{ IDC_SSHHOST_KEY_MOVEUP, "DLG_SSHSETUP_HOST_KEY_UP" },
+		{ IDC_SSHHOST_KEY_MOVEDOWN, "DLG_SSHSETUP_HOST_KEY_DOWN" },
 
-	GetDlgItemText(dlg, IDC_MAC_ORDER, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_MAC", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_MAC_ORDER, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHMAC_MOVEUP, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_MAC_UP", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHMAC_MOVEUP, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHMAC_MOVEDOWN, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_MAC_DOWN", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHMAC_MOVEDOWN, pvar->ts->UIMsg);
+		{ IDC_MAC_ORDER, "DLG_SSHSETUP_MAC" },
+		{ IDC_SSHMAC_MOVEUP, "DLG_SSHSETUP_MAC_UP" },
+		{ IDC_SSHMAC_MOVEDOWN, "DLG_SSHSETUP_MAC_DOWN" },
 
-	GetDlgItemText(dlg, IDC_COMP_ORDER, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_COMP", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_COMP_ORDER, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHCOMP_MOVEUP, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_COMP_UP", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHCOMP_MOVEUP, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHCOMP_MOVEDOWN, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_COMP_DOWN", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHCOMP_MOVEDOWN, pvar->ts->UIMsg);
+		{ IDC_COMP_ORDER, "DLG_SSHSETUP_COMP" },
+		{ IDC_SSHCOMP_MOVEUP, "DLG_SSHSETUP_COMP_UP" },
+		{ IDC_SSHCOMP_MOVEDOWN, "DLG_SSHSETUP_COMP_DOWN" },
 
-	GetDlgItemText(dlg, IDC_KNOWNHOSTS, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_KNOWNHOST", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_KNOWNHOSTS, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_CHOOSEREADWRITEFILE, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_KNOWNHOST_RW", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_CHOOSEREADWRITEFILE, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_CHOOSEREADONLYFILE, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_KNOWNHOST_RO", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_CHOOSEREADONLYFILE, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_HEARTBEATLABEL, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_HEARTBEAT", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_HEARTBEATLABEL, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_HEARTBEATLABEL2, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_HEARTBEAT_UNIT", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_HEARTBEATLABEL2, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_REMEMBERPASSWORD, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_PASSWORD", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_REMEMBERPASSWORD, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_FORWARDAGENT, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_FORWARDAGENT", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_FORWARDAGENT, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_FORWARDAGENTCONFIRM, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_FORWARDAGENTCONFIRM", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_FORWARDAGENTCONFIRM, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_FORWARDAGENTNOTIFY, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_FORWARDAGENTNOTIFY", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_FORWARDAGENTNOTIFY, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_VERIFYHOSTKEYDNS, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_VERIFYHOSTKEYDNS", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_VERIFYHOSTKEYDNS, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_NOTICEBANNER, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_NOTICE", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_NOTICEBANNER, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDOK, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("BTN_OK", pvar, uimsg);
-	SetDlgItemText(dlg, IDOK, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDCANCEL, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("BTN_CANCEL", pvar, uimsg);
-	SetDlgItemText(dlg, IDCANCEL, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_SSHSETUP_HELP, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("BTN_HELP", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_SSHSETUP_HELP, pvar->ts->UIMsg);
+		{ IDC_KNOWNHOSTS, "DLG_SSHSETUP_KNOWNHOST" },
+		{ IDC_CHOOSEREADWRITEFILE, "DLG_SSHSETUP_KNOWNHOST_RW" },
+		{ IDC_CHOOSEREADONLYFILE, "DLG_SSHSETUP_KNOWNHOST_RO" },
+		{ IDC_HEARTBEATLABEL, "DLG_SSHSETUP_HEARTBEAT" },
+		{ IDC_HEARTBEATLABEL2, "DLG_SSHSETUP_HEARTBEAT_UNIT" },
+		{ IDC_REMEMBERPASSWORD, "DLG_SSHSETUP_PASSWORD" },
+		{ IDC_FORWARDAGENT, "DLG_SSHSETUP_FORWARDAGENT" },
+		{ IDC_FORWARDAGENTCONFIRM, "DLG_SSHSETUP_FORWARDAGENTCONFIRM" },
+		{ IDC_FORWARDAGENTNOTIFY, "DLG_SSHSETUP_FORWARDAGENTNOTIFY" },
+		{ IDC_VERIFYHOSTKEYDNS, "DLG_SSHSETUP_VERIFYHOSTKEYDNS" },
+		{ IDC_NOTICEBANNER, "DLG_SSHSETUP_NOTICE" },
+		{ IDOK, "BTN_OK" },
+		{ IDCANCEL, "BTN_CANCEL" },
+		{ IDC_SSHSETUP_HELP, "BTN_HELP" },
 
-	GetDlgItemText(dlg, IDC_HOSTKEY_ROTATION_STATIC, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_HOSTKEY_ROTATION", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_HOSTKEY_ROTATION_STATIC, pvar->ts->UIMsg);
+		{ IDC_HOSTKEY_ROTATION_STATIC, "DLG_SSHSETUP_HOSTKEY_ROTATION" },
+		{ IDC_LOGLEVEL, "DLG_SSHSETUP_LOGLEVEL" },
+		{ IDC_LOGLEVEL_UNIT, "DLG_SSHSETUP_LOGLEVEL_UNIT" },
+	};
+	SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 
-	GetDlgItemText(dlg, IDC_LOGLEVEL, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_LOGLEVEL", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_LOGLEVEL, pvar->ts->UIMsg);
-	GetDlgItemText(dlg, IDC_LOGLEVEL_UNIT, uimsg, sizeof(uimsg));
-	UTIL_get_lang_msg("DLG_SSHSETUP_LOGLEVEL_UNIT", pvar, uimsg);
-	SetDlgItemText(dlg, IDC_LOGLEVEL_UNIT, pvar->ts->UIMsg);
-
-
 	SendMessage(compressionControl, TBM_SETRANGE, TRUE, MAKELONG(0, 9));
 	SendMessage(compressionControl, TBM_SETPOS, TRUE,
 	            pvar->settings.CompressionLevel);
@@ -4259,45 +4156,22 @@
 	switch (msg) {
 	case WM_INITDIALOG:
 		{
-		GetWindowText(dlg, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_KEYGEN_TITLE", pvar, uimsg);
-		SetWindowText(dlg, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_KEYTYPE, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_KEYGEN_KEYTYPE", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_KEYTYPE, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_KEYBITS_LABEL, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_KEYGEN_BITS", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_KEYBITS_LABEL, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_KEY_LABEL, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_KEYGEN_PASSPHRASE", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_KEY_LABEL, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_CONFIRM_LABEL, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_KEYGEN_PASSPHRASE2", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_CONFIRM_LABEL, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_COMMENT_LABEL, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_KEYGEN_COMMENT", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_COMMENT_LABEL, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_SAVE_PUBLIC_KEY, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_KEYGEN_SAVEPUBLIC", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_SAVE_PUBLIC_KEY, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_SAVE_PRIVATE_KEY, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_KEYGEN_SAVEPRIVATE", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_SAVE_PRIVATE_KEY, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDOK, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_KEYGEN_GENERATE", pvar, uimsg);
-		SetDlgItemText(dlg, IDOK, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDCANCEL, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("BTN_CLOSE", pvar, uimsg);
-		SetDlgItemText(dlg, IDCANCEL, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_SSHKEYGENSETUP_HELP, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("BTN_HELP", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_SSHKEYGENSETUP_HELP, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_BCRYPT_KDF_CHECK, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_KEYGEN_BCRYPT_KDF", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_BCRYPT_KDF_CHECK, pvar->ts->UIMsg);
-		GetDlgItemText(dlg, IDC_BCRYPT_KDF_ROUNDS_LABEL, uimsg, sizeof(uimsg));
-		UTIL_get_lang_msg("DLG_KEYGEN_BCRYPT_ROUNDS", pvar, uimsg);
-		SetDlgItemText(dlg, IDC_BCRYPT_KDF_ROUNDS_LABEL, pvar->ts->UIMsg);
+		const static DlgTextInfo text_info[] = {
+			{ 0, "DLG_KEYGEN_TITLE" },
+			{ IDC_KEYTYPE, "DLG_KEYGEN_KEYTYPE" },
+			{ IDC_KEYBITS_LABEL, "DLG_KEYGEN_BITS" },
+			{ IDC_KEY_LABEL, "DLG_KEYGEN_PASSPHRASE" },
+			{ IDC_CONFIRM_LABEL, "DLG_KEYGEN_PASSPHRASE2" },
+			{ IDC_COMMENT_LABEL, "DLG_KEYGEN_COMMENT" },
+			{ IDC_SAVE_PUBLIC_KEY, "DLG_KEYGEN_SAVEPUBLIC" },
+			{ IDC_SAVE_PRIVATE_KEY, "DLG_KEYGEN_SAVEPRIVATE" },
+			{ IDOK, "DLG_KEYGEN_GENERATE" },
+			{ IDCANCEL, "BTN_CLOSE" },
+			{ IDC_BCRYPT_KDF_CHECK, "DLG_KEYGEN_BCRYPT_KDF" },
+			{ IDC_BCRYPT_KDF_ROUNDS_LABEL, "DLG_KEYGEN_BCRYPT_ROUNDS" },
+			{ IDC_SSHKEYGENSETUP_HELP, "BTN_HELP" },
+		};
+		SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
 
 		init_password_control(pvar, dlg, IDC_KEY_EDIT, NULL);
 		init_password_control(pvar, dlg, IDC_CONFIRM_EDIT, NULL);


Ttssh2-commit メーリングリストの案内