• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision10581 (tree)
Time2023-02-06 08:28:17
Authornmaya

Log Message

SCP 関連のメッセージを国際化した

ticket: #44168

Change Summary

Incremental Difference

--- branches/4-stable/ttssh2/ttxssh/resource.h (revision 10580)
+++ branches/4-stable/ttssh2/ttxssh/resource.h (revision 10581)
@@ -163,16 +163,17 @@
163163 #define IDC_SSHFWDLOCALTOREMOTE_CHECKIDENTITY 1089
164164 #define IDC_SENDFILE_SELECT 1090
165165 #define IDC_FILE_PROGRESS 1092
166+#define IDC_SENDFILE_NOTE 1092
166167 #define IDC_FILENAME 1093
167168 #define IDC_RECVDIR_SELECT 1093
168169 #define IDC_PROGRESS 1094
169-#define IDC_FN_STATIC 1095
170+#define IDC_SCP_PROGRESS_FILENAME_LABEL 1095
170171 #define IDC_RECVFILE 1096
171172 #define IDC_RECV 1097
172173 #define IDC_SFTP_TEST 1098
173174 #define IDC_DUMMY_LINE 1099
174175 #define IDC_LOCALUSERNAMELABEL 1100
175-#define IDC_RECV_TO_DIRECTORY 1100
176+#define IDC_RECVFILE_TO_LABEL 1100
176177 #define IDC_LOCALUSERNAME 1101
177178 #define IDC_RECVFILE_TO 1101
178179 #define IDC_CHOOSEHOSTRSAFILE 1102
@@ -243,6 +244,11 @@
243244 #define IDC_SSHSETUP_HELP 1249
244245 #define IDC_SSHFWDSETUP_HELP 1250
245246 #define IDC_SSHAUTHSETUP_HELP 1251
247+#define IDC_SENDFILE_FROM_LABEL 1252
248+#define IDC_SENDFILE_TO_LABEL 1253
249+#define IDC_RECEIVEFILE_FROM_LABEL 1254
250+#define IDC_SCP_PROGRESS_BYTE_LABEL 1255
251+#define IDC_SCP_PROGRESS_TIME_LABEL 1256
246252
247253 // Next default values for new objects
248254 //
@@ -250,7 +256,7 @@
250256 #ifndef APSTUDIO_READONLY_SYMBOLS
251257 #define _APS_NEXT_RESOURCE_VALUE 118
252258 #define _APS_NEXT_COMMAND_VALUE 40001
253-#define _APS_NEXT_CONTROL_VALUE 1252
259+#define _APS_NEXT_CONTROL_VALUE 1257
254260 #define _APS_NEXT_SYMED_VALUE 101
255261 #endif
256262 #endif
--- branches/4-stable/ttssh2/ttxssh/ssh.c (revision 10580)
+++ branches/4-stable/ttssh2/ttxssh/ssh.c (revision 10581)
@@ -4140,7 +4140,9 @@
41404140 if (fp == NULL) {
41414141 char buf[1024];
41424142 int len;
4143- strcpy_s(buf, sizeof(buf), "Can't open file for reading: ");
4143+ UTIL_get_lang_msg("MSG_SSH_SCP_FILEOPEN_READ_ERROR", pvar,
4144+ "Can't open file for reading:");
4145+ _snprintf_s(buf, sizeof(buf), _TRUNCATE, "%s ", pvar->ts->UIMsg);
41444146 len = strlen(buf);
41454147 FormatMessage(
41464148 FORMAT_MESSAGE_FROM_SYSTEM,
@@ -4150,7 +4152,9 @@
41504152 buf+len,
41514153 sizeof(buf)-len,
41524154 NULL);
4153- MessageBox(NULL, buf, "TTSSH: file open error", MB_OK | MB_ICONERROR);
4155+ UTIL_get_lang_msg("MSG_SSH_SCP_FILEOPEN_ERROR_TITLE", pvar,
4156+ "TTSSH: file open error");
4157+ MessageBox(NULL, buf, pvar->ts->UIMsg, MB_OK | MB_ICONERROR);
41544158 goto error;
41554159 }
41564160
@@ -4191,12 +4195,20 @@
41914195 char buf[512];
41924196 int dlgresult;
41934197 if (_access(c->scp.localfilefull, 0x02) == -1) { // 0x02 == writable
4194- _snprintf_s(buf, sizeof(buf), _TRUNCATE, "`%s' file is read only.", c->scp.localfilefull);
4195- MessageBox(NULL, buf, "TTSSH: file open error", MB_OK | MB_ICONERROR);
4198+ UTIL_get_lang_msg("MSG_SSH_SCP_FILEOPEN_READONLY_ERROR", pvar,
4199+ "`%s' file is read only.");
4200+ _snprintf_s(buf, sizeof(buf), _TRUNCATE, pvar->ts->UIMsg, c->scp.localfilefull);
4201+ UTIL_get_lang_msg("MSG_SSH_SCP_FILEOPEN_ERROR_TITLE", pvar,
4202+ "TTSSH: file open error");
4203+ MessageBox(NULL, buf, pvar->ts->UIMsg, MB_OK | MB_ICONERROR);
41964204 goto error;
41974205 }
4198- _snprintf_s(buf, sizeof(buf), _TRUNCATE, "`%s' file exists.\noverwrite it?", c->scp.localfilefull);
4199- dlgresult = MessageBox(NULL, buf, "TTSSH: confirm", MB_YESNO | MB_ICONQUESTION);
4206+ UTIL_get_lang_msg("MSG_SSH_SCP_FILEOPEN_OVERWRITE_CONFIRM", pvar,
4207+ "`%s' file exists.\noverwrite it?");
4208+ _snprintf_s(buf, sizeof(buf), _TRUNCATE, pvar->ts->UIMsg, c->scp.localfilefull);
4209+ UTIL_get_lang_msg("MSG_SSH_SCP_CONFIRM_TITLE", pvar,
4210+ "TTSSH: confirm");
4211+ dlgresult = MessageBox(NULL, buf, pvar->ts->UIMsg, MB_YESNO | MB_ICONQUESTION);
42004212 if (dlgresult == IDNO) {
42014213 goto error;
42024214 }
@@ -4206,7 +4218,9 @@
42064218 if (fp == NULL) {
42074219 char buf[1024];
42084220 int len;
4209- strcpy_s(buf, sizeof(buf), "Can't open file for writing: ");
4221+ UTIL_get_lang_msg("MSG_SSH_SCP_FILEOPEN_WRITE_ERROR", pvar,
4222+ "Can't open file for writing:");
4223+ _snprintf_s(buf, sizeof(buf), _TRUNCATE, "%s ", pvar->ts->UIMsg);
42104224 len = strlen(buf);
42114225 FormatMessage(
42124226 FORMAT_MESSAGE_FROM_SYSTEM,
@@ -4216,7 +4230,9 @@
42164230 buf+len,
42174231 sizeof(buf)-len,
42184232 NULL);
4219- MessageBox(NULL, buf, "TTSSH: file open error", MB_OK | MB_ICONERROR);
4233+ UTIL_get_lang_msg("MSG_SSH_SCP_FILEOPEN_ERROR_TITLE", pvar,
4234+ "TTSSH: file open error");
4235+ MessageBox(NULL, buf, pvar->ts->UIMsg, MB_OK | MB_ICONERROR);
42204236 goto error;
42214237 }
42224238
@@ -8211,8 +8227,16 @@
82118227 c->scp.pvar = pvar;
82128228
82138229 hDlgWnd = CreateDialog(hInst, MAKEINTRESOURCE(IDD_SSHSCP_PROGRESS),
8214- pvar->cv->HWin, (DLGPROC)ssh_scp_dlg_proc);
8230+ pvar->cv->HWin, (DLGPROC)ssh_scp_dlg_proc);
82158231 if (hDlgWnd != NULL) {
8232+ const static DlgTextInfo text_info[] = {
8233+ { 0, "DLG_SCP_PROGRESS_TITLE_SENDFILE" },
8234+ { IDC_SCP_PROGRESS_FILENAME_LABEL, "DLG_SCP_PROGRESS_FILENAME_LABEL" },
8235+ { IDC_SCP_PROGRESS_BYTE_LABEL, "DLG_SCP_PROGRESS_BYTES_LABEL" },
8236+ { IDC_SCP_PROGRESS_TIME_LABEL, "DLG_SCP_PROGRESS_TIME_LABEL" },
8237+ };
8238+ SetI18DlgStrs("TTSSH", hDlgWnd, text_info, _countof(text_info), pvar->ts->UILanguageFile);
8239+
82168240 c->scp.progress_window = hDlgWnd;
82178241 ShowWindow(hDlgWnd, SW_SHOW);
82188242 }
@@ -8470,10 +8494,17 @@
84708494 // 進捗ウィンドウ
84718495 c->scp.pvar = pvar;
84728496 hDlgWnd = CreateDialog(hInst, MAKEINTRESOURCE(IDD_SSHSCP_PROGRESS),
8473- pvar->cv->HWin, (DLGPROC)ssh_scp_dlg_proc);
8497+ pvar->cv->HWin, (DLGPROC)ssh_scp_dlg_proc);
84748498 if (hDlgWnd != NULL) {
8499+ const static DlgTextInfo text_info[] = {
8500+ { 0, "DLG_SCP_PROGRESS_TITLE_RECEIVEFILE" },
8501+ { IDC_SCP_PROGRESS_FILENAME_LABEL, "DLG_SCP_SENDFILE_FROM" },
8502+ { IDC_SCP_PROGRESS_BYTE_LABEL, "DLG_SCP_PROGRESS_BYTES_LABEL" },
8503+ { IDC_SCP_PROGRESS_TIME_LABEL, "DLG_SCP_PROGRESS_TIME_LABEL" },
8504+ };
8505+ SetI18DlgStrs("TTSSH", hDlgWnd, text_info, _countof(text_info), pvar->ts->UILanguageFile);
8506+
84758507 c->scp.progress_window = hDlgWnd;
8476- SetWindowText(hDlgWnd, "TTSSH: SCP receiving file");
84778508 SendMessage(GetDlgItem(hDlgWnd, IDC_FILENAME), WM_SETTEXT, 0, (LPARAM)c->scp.localfilefull);
84788509 ShowWindow(hDlgWnd, SW_SHOW);
84798510 }
@@ -8495,8 +8526,10 @@
84958526 copylen = min(buflen, sizeof(msg));
84968527 memcpy(msg, data, copylen);
84978528 msg[copylen - 1] = 0;
8498- MessageBox(NULL, msg, "TTSSH: SCP error(SCP_INIT)", MB_OK | MB_ICONEXCLAMATION);
84998529
8530+ UTIL_get_lang_msg("MSG_SSH_SCP_ERROR_INIT_TITLE", pvar,
8531+ "TTSSH: SCP error (SCP_INIT)");
8532+ MessageBox(NULL, msg, pvar->ts->UIMsg, MB_OK | MB_ICONEXCLAMATION);
85008533 }
85018534
85028535 } else if (c->scp.state == SCP_DATA) { // payloadの受信
@@ -8577,7 +8610,9 @@
85778610 //ssh2_channel_send_close(pvar, c);
85788611 }
85798612
8580- MessageBox(NULL, msg, "TTSSH: SCP error", MB_OK | MB_ICONEXCLAMATION);
8613+ UTIL_get_lang_msg("MSG_SSH_SCP_ERROR_TITLE", pvar,
8614+ "TTSSH: SCP error");
8615+ MessageBox(NULL, msg, pvar->ts->UIMsg, MB_OK | MB_ICONEXCLAMATION);
85818616 }
85828617 }
85838618
--- branches/4-stable/ttssh2/ttxssh/ttxssh.c (revision 10580)
+++ branches/4-stable/ttssh2/ttxssh/ttxssh.c (revision 10581)
@@ -3414,6 +3414,21 @@
34143414
34153415 switch (msg) {
34163416 case WM_INITDIALOG:
3417+ {
3418+ const static DlgTextInfo text_info[] = {
3419+ { 0, "DLG_SCP_TITLE" },
3420+ { IDC_SENDFILE_FROM_LABEL, "DLG_SCP_SENDFILE_FROM" },
3421+ { IDC_SENDFILE_TO_LABEL, "DLG_SCP_SENDFILE_TO" },
3422+ { IDC_SENDFILE_NOTE, "DLG_SCP_SENDFILE_DRAG" },
3423+ { IDOK, "DLG_SCP_SENDFILE_SEND" },
3424+ { IDCANCEL, "DLG_SCP_SENDFILE_CANCEL" },
3425+ { IDC_RECEIVEFILE_FROM_LABEL, "DLG_SCP_RECEIVEFILE_FROM" },
3426+ { IDC_RECVFILE_TO_LABEL, "DLG_SCP_RECEIVEFILE_TO" },
3427+ { IDC_RECV, "DLG_SCP_RECEIVEFILE_RECEIVE" },
3428+ };
3429+ SetI18DlgStrs("TTSSH", dlg, text_info, _countof(text_info), pvar->ts->UILanguageFile);
3430+ }
3431+
34173432 DragAcceptFiles(dlg, TRUE);
34183433
34193434 // SCPファイル送信先を表示する
@@ -3470,7 +3485,9 @@
34703485 get_lang_msg("FILEDLG_SELECT_LOGVIEW_APP_TITLE", uimsg, sizeof(uimsg),
34713486 "Choose a executing file with launching logging file", ts.UILanguageFile);
34723487 #endif
3473- ofn.lpstrTitle = "Choose a sending file with SCP";
3488+ UTIL_get_lang_msg("DLG_SCP_SELECT_FILE_TITLE", pvar,
3489+ "Choose a sending file with SCP");
3490+ ofn.lpstrTitle = pvar->ts->UIMsg;
34743491
34753492 ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
34763493 ofn.Flags |= OFN_FORCESHOWHIDDEN;
@@ -3485,7 +3502,9 @@
34853502 char buf[MAX_PATH], buf2[MAX_PATH];
34863503 hWnd = GetDlgItem(dlg, IDC_RECVFILE_TO);
34873504 SendMessage(hWnd, WM_GETTEXT , sizeof(buf), (LPARAM)buf);
3488- if (doSelectFolder(dlg, buf2, sizeof(buf2), buf, "Choose destination directory")) {
3505+ UTIL_get_lang_msg("DLG_SCP_SELECT_DEST_TITLE", pvar,
3506+ "Choose destination directory");
3507+ if (doSelectFolder(dlg, buf2, sizeof(buf2), buf, pvar->ts->UIMsg)) {
34893508 strncpy_s(recvdir, sizeof(recvdir), buf2, _TRUNCATE);
34903509 SendMessage(GetDlgItem(dlg, IDC_RECVFILE_TO), WM_SETTEXT, 0, (LPARAM)recvdir);
34913510 }
Show on old repository browser