• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision8469 (tree)
Time2020-01-10 22:14:28
Authorzmatsuo

Log Message

メニューを多言語化

Change Summary

Incremental Difference

--- trunk/ttssh2/ttxssh/ttxssh.c (revision 8468)
+++ trunk/ttssh2/ttxssh/ttxssh.c (revision 8469)
@@ -1,6 +1,6 @@
11 /*
22 * Copyright (c) 1998-2001, Robert O'Callahan
3- * (C) 2004-2019 TeraTerm Project
3+ * (C) 2004-2020 TeraTerm Project
44 * All rights reserved.
55 *
66 * Redistribution and use in source and binary forms, with or without
@@ -2148,13 +2148,8 @@
21482148 }
21492149 }
21502150
2151-#define GetFileMenu(menu) GetSubMenuByChildID(menu, 50110) // ID_FILE_NEWCONNECTION
2152-#define GetEditMenu(menu) GetSubMenuByChildID(menu, 50210) // ID_EDIT_COPY2
2153-#define GetSetupMenu(menu) GetSubMenuByChildID(menu, 50310) // ID_SETUP_TERMINAL
2154-#define GetControlMenu(menu) GetSubMenuByChildID(menu, 50410) // ID_CONTROL_RESETTERMINAL
2155-#define GetHelpMenu(menu) GetSubMenuByChildID(menu, 50990) // ID_HELP_ABOUT
2156-
2157-HMENU GetSubMenuByChildID(HMENU menu, UINT id) {
2151+static HMENU GetSubMenuByChildID(HMENU menu, UINT id)
2152+{
21582153 int i, j, items, subitems, cur_id;
21592154 HMENU m;
21602155
@@ -2176,27 +2171,35 @@
21762171
21772172 static void PASCAL TTXModifyMenu(HMENU menu)
21782173 {
2179- pvar->FileMenu = GetFileMenu(menu);
2174+ static const DlgTextInfo MenuTextInfo[] = {
2175+ { ID_ABOUTMENU, "MENU_ABOUT" },
2176+ { ID_SSHSETUPMENU, "MENU_SSH" },
2177+ { ID_SSHAUTHSETUPMENU, "MENU_SSH_AUTH" },
2178+ { ID_SSHFWDSETUPMENU, "MENU_SSH_FORWARD" },
2179+ { ID_SSHKEYGENMENU, "MENU_SSH_KEYGEN" },
2180+ { ID_SSHSCPMENU, "MENU_SSH_SCP" },
2181+ };
2182+ // teratermのメニューID(tt_res.h)
2183+ const UINT ID_FILE_NEWCONNECTION = 50110;
2184+ const UINT ID_HELP_ABOUT = 50990;
2185+ const UINT ID_SETUP_TCPIP = 50360;
2186+ const UINT ID_FILE_CHANGEDIR = 50170;
21802187
2188+ pvar->FileMenu = GetSubMenuByChildID(menu, ID_FILE_NEWCONNECTION);
2189+
21812190 /* inserts before ID_HELP_ABOUT */
2182- UTIL_get_lang_msg("MENU_ABOUT", pvar, "About &TTSSH...");
2183- insertMenuBeforeItem(menu, 50990, MF_ENABLED, ID_ABOUTMENU, pvar->ts->UIMsg);
2191+ insertMenuBeforeItem(menu, ID_HELP_ABOUT, MF_ENABLED, ID_ABOUTMENU, "About &TTSSH...");
21842192
21852193 /* inserts before ID_SETUP_TCPIP */
2186- UTIL_get_lang_msg("MENU_SSH", pvar, "SS&H...");
2187- insertMenuBeforeItem(menu, 50360, MF_ENABLED, ID_SSHSETUPMENU, pvar->ts->UIMsg);
2188- /* inserts before ID_SETUP_TCPIP */
2189- UTIL_get_lang_msg("MENU_SSH_AUTH", pvar, "SSH &Authentication...");
2190- insertMenuBeforeItem(menu, 50360, MF_ENABLED, ID_SSHAUTHSETUPMENU, pvar->ts->UIMsg);
2191- /* inserts before ID_SETUP_TCPIP */
2192- UTIL_get_lang_msg("MENU_SSH_FORWARD", pvar, "SSH F&orwarding...");
2193- insertMenuBeforeItem(menu, 50360, MF_ENABLED, ID_SSHFWDSETUPMENU, pvar->ts->UIMsg);
2194- UTIL_get_lang_msg("MENU_SSH_KEYGEN", pvar, "SSH KeyGe&nerator...");
2195- insertMenuBeforeItem(menu, 50360, MF_ENABLED, ID_SSHKEYGENMENU, pvar->ts->UIMsg);
2194+ insertMenuBeforeItem(menu, ID_SETUP_TCPIP, MF_ENABLED, ID_SSHSETUPMENU, "SS&H...");
2195+ insertMenuBeforeItem(menu, ID_SETUP_TCPIP, MF_ENABLED, ID_SSHAUTHSETUPMENU, "SSH &Authentication...");
2196+ insertMenuBeforeItem(menu, ID_SETUP_TCPIP, MF_ENABLED, ID_SSHFWDSETUPMENU, "SSH F&orwarding...");
2197+ insertMenuBeforeItem(menu, ID_SETUP_TCPIP, MF_ENABLED, ID_SSHKEYGENMENU, "SSH KeyGe&nerator...");
21962198
21972199 /* inserts before ID_FILE_CHANGEDIR */
2198- UTIL_get_lang_msg("MENU_SSH_SCP", pvar, "SS&H SCP...");
2199- insertMenuBeforeItem(menu, 50170, MF_GRAYED, ID_SSHSCPMENU, pvar->ts->UIMsg);
2200+ insertMenuBeforeItem(menu, ID_FILE_CHANGEDIR, MF_GRAYED, ID_SSHSCPMENU, "SS&H SCP...");
2201+
2202+ SetI18MenuStrs("TTSSH", menu, MenuTextInfo, _countof(MenuTextInfo), pvar->ts->UILanguageFile);
22002203 }
22012204
22022205 static void PASCAL TTXModifyPopupMenu(HMENU menu) {
Show on old repository browser