From f403b1226471370ab203bc66a313fc976e626cd2 Mon Sep 17 00:00:00 2001 From: ArkadiuszMichalski <2730894+ArkadiuszMichalski@users.noreply.github.com> Date: Tue, 14 Feb 2023 09:59:33 +0100 Subject: [PATCH] Make Context menu in Shortcut Mapper (Modify, Delete, Clear) translatable Fix one of issues in https://github.com/notepad-plus-plus/notepad-plus-plus/issues/8972 Close #13120 --- PowerEditor/installer/nativeLang/english.xml | 3 +++ .../installer/nativeLang/english_customizable.xml | 3 +++ PowerEditor/src/WinControls/Grid/ShortcutMapper.cpp | 11 +++++++---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml index f795f3eb4..3b8508767 100644 --- a/PowerEditor/installer/nativeLang/english.xml +++ b/PowerEditor/installer/nativeLang/english.xml @@ -603,6 +603,9 @@ The comments are here for explanation, it's not necessary to translate them. + + + diff --git a/PowerEditor/installer/nativeLang/english_customizable.xml b/PowerEditor/installer/nativeLang/english_customizable.xml index 2a51653a3..d43afc3fb 100644 --- a/PowerEditor/installer/nativeLang/english_customizable.xml +++ b/PowerEditor/installer/nativeLang/english_customizable.xml @@ -547,6 +547,9 @@ + + + diff --git a/PowerEditor/src/WinControls/Grid/ShortcutMapper.cpp b/PowerEditor/src/WinControls/Grid/ShortcutMapper.cpp index 7ce9f5d47..1be525d31 100644 --- a/PowerEditor/src/WinControls/Grid/ShortcutMapper.cpp +++ b/PowerEditor/src/WinControls/Grid/ShortcutMapper.cpp @@ -287,7 +287,6 @@ void ShortcutMapper::fillOutBabyGrid() { case STATE_MENU: { - NativeLangSpeaker* nativeLangSpeaker = NppParameters::getInstance().getNativeLangSpeaker(); vector & cshortcuts = nppParam.getUserShortcuts(); cs_index = 1; for (size_t i = 0; i < nbItems; ++i) @@ -1095,9 +1094,13 @@ intptr_t CALLBACK ShortcutMapper::run_dlgProc(UINT message, WPARAM wParam, LPARA if (!_rightClickMenu.isCreated()) { vector itemUnitArray; - itemUnitArray.push_back(MenuItemUnit(IDM_BABYGRID_MODIFY, TEXT("Modify"))); - itemUnitArray.push_back(MenuItemUnit(IDM_BABYGRID_DELETE, TEXT("Delete"))); - itemUnitArray.push_back(MenuItemUnit(IDM_BABYGRID_CLEAR, TEXT("Clear"))); + NativeLangSpeaker* nativeLangSpeaker = NppParameters::getInstance().getNativeLangSpeaker(); + generic_string modifyStr = nativeLangSpeaker->getShortcutMapperLangStr("ModifyContextMenu", TEXT("Modify")); + generic_string deleteStr = nativeLangSpeaker->getShortcutMapperLangStr("DeleteContextMenu", TEXT("Delete")); + generic_string clearStr = nativeLangSpeaker->getShortcutMapperLangStr("ClearContextMenu", TEXT("Clear")); + itemUnitArray.push_back(MenuItemUnit(IDM_BABYGRID_MODIFY, modifyStr.c_str())); + itemUnitArray.push_back(MenuItemUnit(IDM_BABYGRID_DELETE, deleteStr.c_str())); + itemUnitArray.push_back(MenuItemUnit(IDM_BABYGRID_CLEAR, clearStr.c_str())); _rightClickMenu.create(_hSelf, itemUnitArray); }