diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml index 3ab9cd74d..4adb0a17f 100644 --- a/PowerEditor/installer/nativeLang/english.xml +++ b/PowerEditor/installer/nativeLang/english.xml @@ -24,7 +24,7 @@ The comments are here for explanation, it's not necessary to translate them. - + @@ -404,6 +404,17 @@ The comments are here for explanation, it's not necessary to translate them. + + + + + + + + + + + @@ -651,6 +662,12 @@ The comments are here for explanation, it's not necessary to translate them. + + + + + + diff --git a/PowerEditor/installer/nativeLang/french.xml b/PowerEditor/installer/nativeLang/french.xml index d3fd1fd71..1f41bf1f4 100644 --- a/PowerEditor/installer/nativeLang/french.xml +++ b/PowerEditor/installer/nativeLang/french.xml @@ -24,7 +24,7 @@ The comments are here for explanation, it's not necessary to translate them. - + @@ -402,6 +402,17 @@ The comments are here for explanation, it's not necessary to translate them. + + + + + + + + + + + diff --git a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml index be9055b44..6228e9d9f 100644 --- a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml +++ b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml @@ -393,6 +393,17 @@ + + + + + + + + + + + diff --git a/PowerEditor/src/Notepad_plus.rc b/PowerEditor/src/Notepad_plus.rc index 50c1239c5..4d97103f4 100644 --- a/PowerEditor/src/Notepad_plus.rc +++ b/PowerEditor/src/Notepad_plus.rc @@ -406,7 +406,7 @@ BEGIN MENUITEM "&Rename...", IDM_FILE_RENAME MENUITEM "&Close", IDM_FILE_CLOSE MENUITEM "Clos&e All", IDM_FILE_CLOSEALL - POPUP "Close &More" + POPUP "Close &Multiple Documents" BEGIN MENUITEM "Close All but Active Document", IDM_FILE_CLOSEALL_BUT_CURRENT MENUITEM "Close All to the Left", IDM_FILE_CLOSEALL_TOLEFT diff --git a/PowerEditor/src/NppNotification.cpp b/PowerEditor/src/NppNotification.cpp index 214c4261e..9329414ed 100644 --- a/PowerEditor/src/NppNotification.cpp +++ b/PowerEditor/src/NppNotification.cpp @@ -528,41 +528,39 @@ BOOL Notepad_plus::notify(SCNotification *notification) // IMPORTANT: If list below is modified, you have to change the value of tabContextMenuItemPos[] in localization.cpp file std::vector itemUnitArray; itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CLOSE, TEXT("Close"))); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CLOSEALL_BUT_CURRENT, TEXT("Close All BUT This"))); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CLOSEALL_TOLEFT, TEXT("Close All to the Left"))); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CLOSEALL_TORIGHT, TEXT("Close All to the Right"))); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CLOSEALL_UNCHANGED, TEXT("Close All Unchanged"))); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CLOSEALL_BUT_CURRENT, TEXT("Close All BUT This"), TEXT("Close Multiple Tabs"))); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CLOSEALL_TOLEFT, TEXT("Close All to the Left"), TEXT("Close Multiple Tabs"))); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CLOSEALL_TORIGHT, TEXT("Close All to the Right"), TEXT("Close Multiple Tabs"))); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CLOSEALL_UNCHANGED, TEXT("Close All Unchanged"), TEXT("Close Multiple Tabs"))); itemUnitArray.push_back(MenuItemUnit(IDM_FILE_SAVE, TEXT("Save"))); itemUnitArray.push_back(MenuItemUnit(IDM_FILE_SAVEAS, TEXT("Save As..."))); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_OPEN_FOLDER, TEXT("Open Containing Folder in Explorer"), TEXT("Open into"))); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_OPEN_CMD, TEXT("Open Containing Folder in cmd"), TEXT("Open into"))); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CONTAININGFOLDERASWORKSPACE, TEXT("Open Containing Folder as Workspace"), TEXT("Open into"))); + itemUnitArray.push_back(MenuItemUnit(0, NULL, TEXT("Open into"))); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_OPEN_DEFAULT_VIEWER, TEXT("Open in Default Viewer"), TEXT("Open into"))); itemUnitArray.push_back(MenuItemUnit(IDM_FILE_RENAME, TEXT("Rename"))); itemUnitArray.push_back(MenuItemUnit(IDM_FILE_DELETE, TEXT("Move to Recycle Bin"))); itemUnitArray.push_back(MenuItemUnit(IDM_FILE_RELOAD, TEXT("Reload"))); itemUnitArray.push_back(MenuItemUnit(IDM_FILE_PRINT, TEXT("Print"))); itemUnitArray.push_back(MenuItemUnit(0, NULL)); - itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_1, TEXT("Apply Color 1"))); - itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_2, TEXT("Apply Color 2"))); - itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_3, TEXT("Apply Color 3"))); - itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_4, TEXT("Apply Color 4"))); - itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_5, TEXT("Apply Color 5"))); - itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_NONE, TEXT("Remove Color"))); - itemUnitArray.push_back(MenuItemUnit(0, NULL)); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_OPEN_FOLDER, TEXT("Open Containing Folder in Explorer"))); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_OPEN_CMD, TEXT("Open Containing Folder in cmd"))); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CONTAININGFOLDERASWORKSPACE, TEXT("Open Containing Folder as Workspace"))); - itemUnitArray.push_back(MenuItemUnit(0, NULL)); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_OPEN_DEFAULT_VIEWER, TEXT("Open in Default Viewer"))); itemUnitArray.push_back(MenuItemUnit(0, NULL)); itemUnitArray.push_back(MenuItemUnit(IDM_EDIT_SETREADONLY, TEXT("Read-Only"))); itemUnitArray.push_back(MenuItemUnit(IDM_EDIT_CLEARREADONLY, TEXT("Clear Read-Only Flag"))); itemUnitArray.push_back(MenuItemUnit(0, NULL)); - itemUnitArray.push_back(MenuItemUnit(IDM_EDIT_FULLPATHTOCLIP, TEXT("Copy Full File Path"))); - itemUnitArray.push_back(MenuItemUnit(IDM_EDIT_FILENAMETOCLIP, TEXT("Copy Filename"))); - itemUnitArray.push_back(MenuItemUnit(IDM_EDIT_CURRENTDIRTOCLIP, TEXT("Copy Current Dir. Path"))); - itemUnitArray.push_back(MenuItemUnit(0, NULL)); - itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_GOTO_ANOTHER_VIEW, TEXT("Move to Other View"))); - itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_CLONE_TO_ANOTHER_VIEW, TEXT("Clone to Other View"))); - itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_GOTO_NEW_INSTANCE, TEXT("Move to New Instance"))); - itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_LOAD_IN_NEW_INSTANCE, TEXT("Open in New Instance"))); + itemUnitArray.push_back(MenuItemUnit(IDM_EDIT_FULLPATHTOCLIP, TEXT("Copy Full File Path"), TEXT("Copy to Clipboard"))); + itemUnitArray.push_back(MenuItemUnit(IDM_EDIT_FILENAMETOCLIP, TEXT("Copy Filename"), TEXT("Copy to Clipboard"))); + itemUnitArray.push_back(MenuItemUnit(IDM_EDIT_CURRENTDIRTOCLIP, TEXT("Copy Current Dir. Path"), TEXT("Copy to Clipboard"))); + itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_GOTO_ANOTHER_VIEW, TEXT("Move to Other View"), TEXT("Move Document"))); + itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_CLONE_TO_ANOTHER_VIEW, TEXT("Clone to Other View"), TEXT("Move Document"))); + itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_GOTO_NEW_INSTANCE, TEXT("Move to New Instance"), TEXT("Move Document"))); + itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_LOAD_IN_NEW_INSTANCE, TEXT("Open in New Instance"), TEXT("Move Document"))); + itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_1, TEXT("Apply Color 1"), TEXT("Apply Color to Tab"))); + itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_2, TEXT("Apply Color 2"), TEXT("Apply Color to Tab"))); + itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_3, TEXT("Apply Color 3"), TEXT("Apply Color to Tab"))); + itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_4, TEXT("Apply Color 4"), TEXT("Apply Color to Tab"))); + itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_5, TEXT("Apply Color 5"), TEXT("Apply Color to Tab"))); + itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_NONE, TEXT("Remove Color"), TEXT("Apply Color to Tab"))); // IMPORTANT: If list above is modified, you have to change the value of tabContextMenuItemPos[] in localization.cpp file _tabPopupMenu.create(_pPublicInterface->getHSelf(), itemUnitArray); diff --git a/PowerEditor/src/localization.cpp b/PowerEditor/src/localization.cpp index 51ebc8522..95a559e10 100644 --- a/PowerEditor/src/localization.cpp +++ b/PowerEditor/src/localization.cpp @@ -377,43 +377,51 @@ void NativeLangSpeaker::changeMenuLang(HMENU menuHandle) } -static const int tabContextMenuItemPos[] = +static const std::pair tabContextMenuItemPos[] = { - // +-------------- The item position in tab context menu - // | - // | +------ Index order (CMDID) in of english.xml - // | | - 0, // 0: Close - 1, // 1: Close ALL BUT This - 5, // 2: Save - 6, // 3: Save As - 10, // 4: Print - 32, // 5: Move to Other View - 33, // 6: Clone to Other View - 28, // 7: Copy Full File Path - 29, // 8: Copy Filename - 30, // 9: Copy Current Dir. Path - 7, // 10: Rename - 8, // 11: Move to Recycle Bin - 25, // 12: Read-Only - 24, // 13: Clear Read-Only Flag - 34, // 14: Move to New Instance - 35, // 15: Open to New Instance - 9, // 16: Reload - 2, // 17: Close ALL to the Left - 3, // 18: Close ALL to the Right - 19, // 19: Open Containing Folder in Explorer - 20, // 20: Open Containing Folder in cmd - 23, // 21: Open in Default Viewer - 4, // 22: Close ALL Unchanged - 21, // 23: Open Containing Folder as Workspace - 12, // 24: Apply Color - 13, // 25: Apply Color - 14, // 26: Apply Color - 15, // 27: Apply Color - 16, // 28: Apply Color - 17, // 29: Remove Color - -1 //-------End +// +-------------- The item position on the top level of tab context menu +// | +// | +-------------- The item position in sub-menu of tab context menu. The item is on top level if -1, otherwise it's in the sub-menu +// | | +// | | +--------- Index order (CMID: Context Menu ID) in of english.xml - the number and the order of this array should be synchronized with +// | | | + {0, -1}, // 0: Close + {1, 0}, // 1: Close ALL BUT This + {2, -1}, // 2: Save + {3, -1}, // 3: Save As + {8, -1}, // 4: Print + {14, 0}, // 5: Move to Other View + {14, 1}, // 6: Clone to Other View + {13, 0}, // 7: Copy Full File Path + {13, 1}, // 8: Copy Filename + {13, 2}, // 9: Copy Current Dir. Path + {5, -1}, // 10: Rename + {6, -1}, // 11: Move to Recycle Bin + {10, -1}, // 12: Read-Only + {11, -1}, // 13: Clear Read-Only Flag + {14, 2}, // 14: Move to New Instance + {14, 3}, // 15: Open to New Instance + {7, -1}, // 16: Reload + {1, 1}, // 17: Close ALL to the Left + {1, 2}, // 18: Close ALL to the Right + {4, 0}, // 19: Open Containing Folder in Explorer + {4, 1}, // 20: Open Containing Folder in cmd + {4, 4}, // 21: Open in Default Viewer + {1, 3}, // 22: Close ALL Unchanged + {4, 2}, // 23: Open Containing Folder as Workspace + {15, 0}, // 24: Apply Color + {15, 1}, // 25: Apply Color + {15, 2}, // 26: Apply Color + {15, 3}, // 27: Apply Color + {15, 4}, // 28: Apply Color + {15, 5}, // 29: Remove Color + {1, -1}, // 30: Close Multiple Tabs + {4, -1}, // 31: Open into + {13, -1}, // 32: Copy to Clipboard + {14, -1}, // 33: Move Document + {15, -1}, // Apply Color to Tab + + {-1, -1}, //-------End }; @@ -428,7 +436,7 @@ void NativeLangSpeaker::changeLangTabContextMenu(HMENU hCM) if (tabBarMenu) { WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance(); - int nbCMItems = sizeof(tabContextMenuItemPos)/sizeof(int); + int nbCMItems = sizeof(tabContextMenuItemPos)/sizeof(std::pair); for (TiXmlNodeA *childNode = tabBarMenu->FirstChildElement("Item"); childNode ; @@ -440,13 +448,26 @@ void NativeLangSpeaker::changeLangTabContextMenu(HMENU hCM) if (!indexStr || (index < 0 || index >= nbCMItems-1)) continue; - int pos = tabContextMenuItemPos[index]; + std::pair pos = tabContextMenuItemPos[index]; const char *pName = element->Attribute("name"); if (pName) { const wchar_t *pNameW = wmc.char2wchar(pName, _nativeLangEncoding); - int cmdID = ::GetMenuItemID(hCM, pos); - ::ModifyMenu(hCM, pos, MF_BYPOSITION, cmdID, pNameW); + + if (pos.second == -1) // the 1st level + { + int cmdID = ::GetMenuItemID(hCM, pos.first); + ::ModifyMenu(hCM, pos.first, MF_BYPOSITION, cmdID, pNameW); + } + else // it's the sub-menu item + { + HMENU hSubMenu = ::GetSubMenu(hCM, pos.first); + if (!hSubMenu) + continue; + + int cmdID = ::GetMenuItemID(hSubMenu, pos.second); + ::ModifyMenu(hSubMenu, pos.second, MF_BYPOSITION, cmdID, pNameW); + } } } } diff --git a/PowerEditor/src/menuCmdID.h b/PowerEditor/src/menuCmdID.h index 4c5bab440..476a9a291 100644 --- a/PowerEditor/src/menuCmdID.h +++ b/PowerEditor/src/menuCmdID.h @@ -68,7 +68,7 @@ //10 Rename... //11 Close //12 Close All -//13 Close More +//13 Close Multiple Documents //14 Move to Recycle Bin //15 -------- //16 Load Session...