• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision10582 (tree)
Time2023-02-06 08:28:28
Authornmaya

Log Message

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

ticket: #44168

Change Summary

Incremental Difference

--- trunk/ttssh2/ttxssh/resource.h (revision 10581)
+++ trunk/ttssh2/ttxssh/resource.h (revision 10582)
@@ -162,16 +162,17 @@
162162 #define IDC_SSHFWDLOCALTOREMOTE_CHECKIDENTITY 1089
163163 #define IDC_SENDFILE_SELECT 1090
164164 #define IDC_FILE_PROGRESS 1092
165+#define IDC_SENDFILE_NOTE 1092
165166 #define IDC_FILENAME 1093
166167 #define IDC_RECVDIR_SELECT 1093
167168 #define IDC_PROGRESS 1094
168-#define IDC_FN_STATIC 1095
169+#define IDC_SCP_PROGRESS_FILENAME_LABEL 1095
169170 #define IDC_RECVFILE 1096
170171 #define IDC_RECV 1097
171172 #define IDC_SFTP_TEST 1098
172173 #define IDC_DUMMY_LINE 1099
173174 #define IDC_LOCALUSERNAMELABEL 1100
174-#define IDC_RECV_TO_DIRECTORY 1100
175+#define IDC_RECVFILE_TO_LABEL 1100
175176 #define IDC_LOCALUSERNAME 1101
176177 #define IDC_RECVFILE_TO 1101
177178 #define IDC_CHOOSEHOSTRSAFILE 1102
@@ -241,6 +242,11 @@
241242 #define IDC_SSHSETUP_HELP 1249
242243 #define IDC_SSHFWDSETUP_HELP 1250
243244 #define IDC_SSHAUTHSETUP_HELP 1251
245+#define IDC_SENDFILE_FROM_LABEL 1252
246+#define IDC_SENDFILE_TO_LABEL 1253
247+#define IDC_RECEIVEFILE_FROM_LABEL 1254
248+#define IDC_SCP_PROGRESS_BYTE_LABEL 1255
249+#define IDC_SCP_PROGRESS_TIME_LABEL 1256
244250
245251 // Next default values for new objects
246252 //
@@ -248,7 +254,7 @@
248254 #ifndef APSTUDIO_READONLY_SYMBOLS
249255 #define _APS_NEXT_RESOURCE_VALUE 118
250256 #define _APS_NEXT_COMMAND_VALUE 40001
251-#define _APS_NEXT_CONTROL_VALUE 1252
257+#define _APS_NEXT_CONTROL_VALUE 1257
252258 #define _APS_NEXT_SYMED_VALUE 101
253259 #endif
254260 #endif
--- trunk/ttssh2/ttxssh/ssh.c (revision 10581)
+++ trunk/ttssh2/ttxssh/ssh.c (revision 10582)
@@ -4235,7 +4235,9 @@
42354235 if (fp == NULL) {
42364236 char buf[1024];
42374237 int len;
4238- strcpy_s(buf, sizeof(buf), "Can't open file for reading: ");
4238+ UTIL_get_lang_msg("MSG_SSH_SCP_FILEOPEN_READ_ERROR", pvar,
4239+ "Can't open file for reading:");
4240+ _snprintf_s(buf, sizeof(buf), _TRUNCATE, "%s ", pvar->ts->UIMsg);
42394241 len = strlen(buf);
42404242 FormatMessage(
42414243 FORMAT_MESSAGE_FROM_SYSTEM,
@@ -4245,7 +4247,9 @@
42454247 buf+len,
42464248 sizeof(buf)-len,
42474249 NULL);
4248- MessageBox(NULL, buf, "TTSSH: file open error", MB_OK | MB_ICONERROR);
4250+ UTIL_get_lang_msg("MSG_SSH_SCP_FILEOPEN_ERROR_TITLE", pvar,
4251+ "TTSSH: file open error");
4252+ MessageBox(NULL, buf, pvar->ts->UIMsg, MB_OK | MB_ICONERROR);
42494253 goto error;
42504254 }
42514255
@@ -4286,12 +4290,20 @@
42864290 char buf[512];
42874291 int dlgresult;
42884292 if (_access(c->scp.localfilefull, 0x02) == -1) { // 0x02 == writable
4289- _snprintf_s(buf, sizeof(buf), _TRUNCATE, "`%s' file is read only.", c->scp.localfilefull);
4290- MessageBox(NULL, buf, "TTSSH: file open error", MB_OK | MB_ICONERROR);
4293+ UTIL_get_lang_msg("MSG_SSH_SCP_FILEOPEN_READONLY_ERROR", pvar,
4294+ "`%s' file is read only.");
4295+ _snprintf_s(buf, sizeof(buf), _TRUNCATE, pvar->ts->UIMsg, c->scp.localfilefull);
4296+ UTIL_get_lang_msg("MSG_SSH_SCP_FILEOPEN_ERROR_TITLE", pvar,
4297+ "TTSSH: file open error");
4298+ MessageBox(NULL, buf, pvar->ts->UIMsg, MB_OK | MB_ICONERROR);
42914299 goto error;
42924300 }
4293- _snprintf_s(buf, sizeof(buf), _TRUNCATE, "`%s' file exists.\noverwrite it?", c->scp.localfilefull);
4294- dlgresult = MessageBox(NULL, buf, "TTSSH: confirm", MB_YESNO | MB_ICONQUESTION);
4301+ UTIL_get_lang_msg("MSG_SSH_SCP_FILEOPEN_OVERWRITE_CONFIRM", pvar,
4302+ "`%s' file exists.\noverwrite it?");
4303+ _snprintf_s(buf, sizeof(buf), _TRUNCATE, pvar->ts->UIMsg, c->scp.localfilefull);
4304+ UTIL_get_lang_msg("MSG_SSH_SCP_CONFIRM_TITLE", pvar,
4305+ "TTSSH: confirm");
4306+ dlgresult = MessageBox(NULL, buf, pvar->ts->UIMsg, MB_YESNO | MB_ICONQUESTION);
42954307 if (dlgresult == IDNO) {
42964308 goto error;
42974309 }
@@ -4301,7 +4313,9 @@
43014313 if (fp == NULL) {
43024314 char buf[1024];
43034315 int len;
4304- strcpy_s(buf, sizeof(buf), "Can't open file for writing: ");
4316+ UTIL_get_lang_msg("MSG_SSH_SCP_FILEOPEN_WRITE_ERROR", pvar,
4317+ "Can't open file for writing:");
4318+ _snprintf_s(buf, sizeof(buf), _TRUNCATE, "%s ", pvar->ts->UIMsg);
43054319 len = strlen(buf);
43064320 FormatMessage(
43074321 FORMAT_MESSAGE_FROM_SYSTEM,
@@ -4311,7 +4325,9 @@
43114325 buf+len,
43124326 sizeof(buf)-len,
43134327 NULL);
4314- MessageBox(NULL, buf, "TTSSH: file open error", MB_OK | MB_ICONERROR);
4328+ UTIL_get_lang_msg("MSG_SSH_SCP_FILEOPEN_ERROR_TITLE", pvar,
4329+ "TTSSH: file open error");
4330+ MessageBox(NULL, buf, pvar->ts->UIMsg, MB_OK | MB_ICONERROR);
43154331 goto error;
43164332 }
43174333
@@ -8318,8 +8334,16 @@
83188334 c->scp.pvar = pvar;
83198335
83208336 hDlgWnd = CreateDialog(hInst, MAKEINTRESOURCE(IDD_SSHSCP_PROGRESS),
8321- pvar->cv->HWin, (DLGPROC)ssh_scp_dlg_proc);
8337+ pvar->cv->HWin, (DLGPROC)ssh_scp_dlg_proc);
83228338 if (hDlgWnd != NULL) {
8339+ static const DlgTextInfo text_info[] = {
8340+ { 0, "DLG_SCP_PROGRESS_TITLE_SENDFILE" },
8341+ { IDC_SCP_PROGRESS_FILENAME_LABEL, "DLG_SCP_PROGRESS_FILENAME_LABEL" },
8342+ { IDC_SCP_PROGRESS_BYTE_LABEL, "DLG_SCP_PROGRESS_BYTES_LABEL" },
8343+ { IDC_SCP_PROGRESS_TIME_LABEL, "DLG_SCP_PROGRESS_TIME_LABEL" },
8344+ };
8345+ SetI18nDlgStrsW(hDlgWnd, "TTSSH", text_info, _countof(text_info), pvar->ts->UILanguageFileW);
8346+
83238347 c->scp.progress_window = hDlgWnd;
83248348 ShowWindow(hDlgWnd, SW_SHOW);
83258349 }
@@ -8577,10 +8601,17 @@
85778601 // 進捗ウィンドウ
85788602 c->scp.pvar = pvar;
85798603 hDlgWnd = CreateDialog(hInst, MAKEINTRESOURCE(IDD_SSHSCP_PROGRESS),
8580- pvar->cv->HWin, (DLGPROC)ssh_scp_dlg_proc);
8604+ pvar->cv->HWin, (DLGPROC)ssh_scp_dlg_proc);
85818605 if (hDlgWnd != NULL) {
8606+ static const DlgTextInfo text_info[] = {
8607+ { 0, "DLG_SCP_PROGRESS_TITLE_RECEIVEFILE" },
8608+ { IDC_SCP_PROGRESS_FILENAME_LABEL, "DLG_SCP_SENDFILE_FROM" },
8609+ { IDC_SCP_PROGRESS_BYTE_LABEL, "DLG_SCP_PROGRESS_BYTES_LABEL" },
8610+ { IDC_SCP_PROGRESS_TIME_LABEL, "DLG_SCP_PROGRESS_TIME_LABEL" },
8611+ };
8612+ SetI18nDlgStrsW(hDlgWnd, "TTSSH", text_info, _countof(text_info), pvar->ts->UILanguageFileW);
8613+
85828614 c->scp.progress_window = hDlgWnd;
8583- SetWindowText(hDlgWnd, "TTSSH: SCP receiving file");
85848615 SendMessage(GetDlgItem(hDlgWnd, IDC_FILENAME), WM_SETTEXT, 0, (LPARAM)c->scp.localfilefull);
85858616 ShowWindow(hDlgWnd, SW_SHOW);
85868617 }
@@ -8602,8 +8633,10 @@
86028633 copylen = min(buflen, sizeof(msg));
86038634 memcpy(msg, data, copylen);
86048635 msg[copylen - 1] = 0;
8605- MessageBox(NULL, msg, "TTSSH: SCP error(SCP_INIT)", MB_OK | MB_ICONEXCLAMATION);
86068636
8637+ UTIL_get_lang_msg("MSG_SSH_SCP_ERROR_INIT_TITLE", pvar,
8638+ "TTSSH: SCP error (SCP_INIT)");
8639+ MessageBox(NULL, msg, pvar->ts->UIMsg, MB_OK | MB_ICONEXCLAMATION);
86078640 }
86088641
86098642 } else if (c->scp.state == SCP_DATA) { // payloadの受信
@@ -8684,7 +8717,9 @@
86848717 //ssh2_channel_send_close(pvar, c);
86858718 }
86868719
8687- MessageBox(NULL, msg, "TTSSH: SCP error", MB_OK | MB_ICONEXCLAMATION);
8720+ UTIL_get_lang_msg("MSG_SSH_SCP_ERROR_TITLE", pvar,
8721+ "TTSSH: SCP error");
8722+ MessageBox(NULL, msg, pvar->ts->UIMsg, MB_OK | MB_ICONEXCLAMATION);
86888723 }
86898724 }
86908725
--- trunk/ttssh2/ttxssh/ttxssh.c (revision 10581)
+++ trunk/ttssh2/ttxssh/ttxssh.c (revision 10582)
@@ -3269,6 +3269,21 @@
32693269
32703270 switch (msg) {
32713271 case WM_INITDIALOG:
3272+ {
3273+ static const DlgTextInfo text_info[] = {
3274+ { 0, "DLG_SCP_TITLE" },
3275+ { IDC_SENDFILE_FROM_LABEL, "DLG_SCP_SENDFILE_FROM" },
3276+ { IDC_SENDFILE_TO_LABEL, "DLG_SCP_SENDFILE_TO" },
3277+ { IDC_SENDFILE_NOTE, "DLG_SCP_SENDFILE_DRAG" },
3278+ { IDOK, "DLG_SCP_SENDFILE_SEND" },
3279+ { IDCANCEL, "DLG_SCP_SENDFILE_CANCEL" },
3280+ { IDC_RECEIVEFILE_FROM_LABEL, "DLG_SCP_RECEIVEFILE_FROM" },
3281+ { IDC_RECVFILE_TO_LABEL, "DLG_SCP_RECEIVEFILE_TO" },
3282+ { IDC_RECV, "DLG_SCP_RECEIVEFILE_RECEIVE" },
3283+ };
3284+ SetI18nDlgStrsW(dlg, "TTSSH", text_info, _countof(text_info), pvar->ts->UILanguageFileW);
3285+ }
3286+
32723287 DragAcceptFiles(dlg, TRUE);
32733288
32743289 // SCPファイル送信先を表示する
@@ -3325,7 +3340,9 @@
33253340 get_lang_msg("FILEDLG_SELECT_LOGVIEW_APP_TITLE", uimsg, sizeof(uimsg),
33263341 "Choose a executing file with launching logging file", ts.UILanguageFile);
33273342 #endif
3328- ofn.lpstrTitle = "Choose a sending file with SCP";
3343+ UTIL_get_lang_msg("DLG_SCP_SELECT_FILE_TITLE", pvar,
3344+ "Choose a sending file with SCP");
3345+ ofn.lpstrTitle = pvar->ts->UIMsg;
33293346
33303347 ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
33313348 ofn.Flags |= OFN_FORCESHOWHIDDEN;
@@ -3337,9 +3354,11 @@
33373354 return TRUE;
33383355 case IDC_RECVDIR_SELECT | (BN_CLICKED << 16):
33393356 {
3340- wchar_t *buf, *buf2;
3357+ wchar_t *buf, *buf2, uimsg[MAX_UIMSG];
33413358 hGetDlgItemTextW(dlg, IDC_RECVFILE_TO, &buf);
3342- if (doSelectFolderW(dlg, buf, L"Choose destination directory", &buf2)) {
3359+ UTIL_get_lang_msgW("DLG_SCP_SELECT_DEST_TITLE", pvar,
3360+ L"Choose destination directory", uimsg);
3361+ if (doSelectFolderW(dlg, buf, uimsg, &buf2)) {
33433362 WideCharToACP_t(buf2, recvdir, sizeof(recvdir));
33443363 SetDlgItemTextA(dlg, IDC_RECVFILE_TO, recvdir);
33453364 free(buf2);
Show on old repository browser