SCP 関連のメッセージを国際化した
ticket: #44168
@@ -162,16 +162,17 @@ | ||
162 | 162 | #define IDC_SSHFWDLOCALTOREMOTE_CHECKIDENTITY 1089 |
163 | 163 | #define IDC_SENDFILE_SELECT 1090 |
164 | 164 | #define IDC_FILE_PROGRESS 1092 |
165 | +#define IDC_SENDFILE_NOTE 1092 | |
165 | 166 | #define IDC_FILENAME 1093 |
166 | 167 | #define IDC_RECVDIR_SELECT 1093 |
167 | 168 | #define IDC_PROGRESS 1094 |
168 | -#define IDC_FN_STATIC 1095 | |
169 | +#define IDC_SCP_PROGRESS_FILENAME_LABEL 1095 | |
169 | 170 | #define IDC_RECVFILE 1096 |
170 | 171 | #define IDC_RECV 1097 |
171 | 172 | #define IDC_SFTP_TEST 1098 |
172 | 173 | #define IDC_DUMMY_LINE 1099 |
173 | 174 | #define IDC_LOCALUSERNAMELABEL 1100 |
174 | -#define IDC_RECV_TO_DIRECTORY 1100 | |
175 | +#define IDC_RECVFILE_TO_LABEL 1100 | |
175 | 176 | #define IDC_LOCALUSERNAME 1101 |
176 | 177 | #define IDC_RECVFILE_TO 1101 |
177 | 178 | #define IDC_CHOOSEHOSTRSAFILE 1102 |
@@ -241,6 +242,11 @@ | ||
241 | 242 | #define IDC_SSHSETUP_HELP 1249 |
242 | 243 | #define IDC_SSHFWDSETUP_HELP 1250 |
243 | 244 | #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 | |
244 | 250 | |
245 | 251 | // Next default values for new objects |
246 | 252 | // |
@@ -248,7 +254,7 @@ | ||
248 | 254 | #ifndef APSTUDIO_READONLY_SYMBOLS |
249 | 255 | #define _APS_NEXT_RESOURCE_VALUE 118 |
250 | 256 | #define _APS_NEXT_COMMAND_VALUE 40001 |
251 | -#define _APS_NEXT_CONTROL_VALUE 1252 | |
257 | +#define _APS_NEXT_CONTROL_VALUE 1257 | |
252 | 258 | #define _APS_NEXT_SYMED_VALUE 101 |
253 | 259 | #endif |
254 | 260 | #endif |
@@ -4235,7 +4235,9 @@ | ||
4235 | 4235 | if (fp == NULL) { |
4236 | 4236 | char buf[1024]; |
4237 | 4237 | 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); | |
4239 | 4241 | len = strlen(buf); |
4240 | 4242 | FormatMessage( |
4241 | 4243 | FORMAT_MESSAGE_FROM_SYSTEM, |
@@ -4245,7 +4247,9 @@ | ||
4245 | 4247 | buf+len, |
4246 | 4248 | sizeof(buf)-len, |
4247 | 4249 | 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); | |
4249 | 4253 | goto error; |
4250 | 4254 | } |
4251 | 4255 |
@@ -4286,12 +4290,20 @@ | ||
4286 | 4290 | char buf[512]; |
4287 | 4291 | int dlgresult; |
4288 | 4292 | 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); | |
4291 | 4299 | goto error; |
4292 | 4300 | } |
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); | |
4295 | 4307 | if (dlgresult == IDNO) { |
4296 | 4308 | goto error; |
4297 | 4309 | } |
@@ -4301,7 +4313,9 @@ | ||
4301 | 4313 | if (fp == NULL) { |
4302 | 4314 | char buf[1024]; |
4303 | 4315 | 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); | |
4305 | 4319 | len = strlen(buf); |
4306 | 4320 | FormatMessage( |
4307 | 4321 | FORMAT_MESSAGE_FROM_SYSTEM, |
@@ -4311,7 +4325,9 @@ | ||
4311 | 4325 | buf+len, |
4312 | 4326 | sizeof(buf)-len, |
4313 | 4327 | 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); | |
4315 | 4331 | goto error; |
4316 | 4332 | } |
4317 | 4333 |
@@ -8318,8 +8334,16 @@ | ||
8318 | 8334 | c->scp.pvar = pvar; |
8319 | 8335 | |
8320 | 8336 | 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); | |
8322 | 8338 | 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 | + | |
8323 | 8347 | c->scp.progress_window = hDlgWnd; |
8324 | 8348 | ShowWindow(hDlgWnd, SW_SHOW); |
8325 | 8349 | } |
@@ -8577,10 +8601,17 @@ | ||
8577 | 8601 | // 進捗ウィンドウ |
8578 | 8602 | c->scp.pvar = pvar; |
8579 | 8603 | 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); | |
8581 | 8605 | 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 | + | |
8582 | 8614 | c->scp.progress_window = hDlgWnd; |
8583 | - SetWindowText(hDlgWnd, "TTSSH: SCP receiving file"); | |
8584 | 8615 | SendMessage(GetDlgItem(hDlgWnd, IDC_FILENAME), WM_SETTEXT, 0, (LPARAM)c->scp.localfilefull); |
8585 | 8616 | ShowWindow(hDlgWnd, SW_SHOW); |
8586 | 8617 | } |
@@ -8602,8 +8633,10 @@ | ||
8602 | 8633 | copylen = min(buflen, sizeof(msg)); |
8603 | 8634 | memcpy(msg, data, copylen); |
8604 | 8635 | msg[copylen - 1] = 0; |
8605 | - MessageBox(NULL, msg, "TTSSH: SCP error(SCP_INIT)", MB_OK | MB_ICONEXCLAMATION); | |
8606 | 8636 | |
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); | |
8607 | 8640 | } |
8608 | 8641 | |
8609 | 8642 | } else if (c->scp.state == SCP_DATA) { // payloadの受信 |
@@ -8684,7 +8717,9 @@ | ||
8684 | 8717 | //ssh2_channel_send_close(pvar, c); |
8685 | 8718 | } |
8686 | 8719 | |
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); | |
8688 | 8723 | } |
8689 | 8724 | } |
8690 | 8725 |
@@ -3269,6 +3269,21 @@ | ||
3269 | 3269 | |
3270 | 3270 | switch (msg) { |
3271 | 3271 | 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 | + | |
3272 | 3287 | DragAcceptFiles(dlg, TRUE); |
3273 | 3288 | |
3274 | 3289 | // SCPファイル送信先を表示する |
@@ -3325,7 +3340,9 @@ | ||
3325 | 3340 | get_lang_msg("FILEDLG_SELECT_LOGVIEW_APP_TITLE", uimsg, sizeof(uimsg), |
3326 | 3341 | "Choose a executing file with launching logging file", ts.UILanguageFile); |
3327 | 3342 | #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; | |
3329 | 3346 | |
3330 | 3347 | ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; |
3331 | 3348 | ofn.Flags |= OFN_FORCESHOWHIDDEN; |
@@ -3337,9 +3354,11 @@ | ||
3337 | 3354 | return TRUE; |
3338 | 3355 | case IDC_RECVDIR_SELECT | (BN_CLICKED << 16): |
3339 | 3356 | { |
3340 | - wchar_t *buf, *buf2; | |
3357 | + wchar_t *buf, *buf2, uimsg[MAX_UIMSG]; | |
3341 | 3358 | 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)) { | |
3343 | 3362 | WideCharToACP_t(buf2, recvdir, sizeof(recvdir)); |
3344 | 3363 | SetDlgItemTextA(dlg, IDC_RECVFILE_TO, recvdir); |
3345 | 3364 | free(buf2); |