From 9c0e1e4559a4b7c89bd2c4b9acf6d4f22ede7c80 Mon Sep 17 00:00:00 2001 From: ArkadiuszMichalski <2730894+ArkadiuszMichalski@users.noreply.github.com> Date: Fri, 17 Feb 2023 12:07:27 +0100 Subject: [PATCH] Fix "Recent Files" menu lost translation Fix #9343, close #13208 --- PowerEditor/src/ScintillaComponent/UserDefineDialog.cpp | 2 +- PowerEditor/src/lastRecentFileList.cpp | 2 +- PowerEditor/src/localization.cpp | 8 ++++---- PowerEditor/src/localization.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/PowerEditor/src/ScintillaComponent/UserDefineDialog.cpp b/PowerEditor/src/ScintillaComponent/UserDefineDialog.cpp index ed7a13f00..ae03ca032 100644 --- a/PowerEditor/src/ScintillaComponent/UserDefineDialog.cpp +++ b/PowerEditor/src/ScintillaComponent/UserDefineDialog.cpp @@ -947,7 +947,7 @@ void UserDefineDialog::changeStyle() idStr = std::to_string(IDC_DOCK_BUTTON); } - dockButtonLabel= pNativeSpeaker->getAttrNameByIdStr(defauleLabel.c_str(), targetNode, idStr.c_str()); + dockButtonLabel = pNativeSpeaker->getAttrNameByIdStr(defauleLabel.c_str(), targetNode, idStr.c_str()); ::SetDlgItemText(_hSelf, IDC_DOCK_BUTTON, dockButtonLabel.c_str()); auto style = ::GetWindowLongPtr(_hSelf, GWL_STYLE); diff --git a/PowerEditor/src/lastRecentFileList.cpp b/PowerEditor/src/lastRecentFileList.cpp index 606fc77f7..565f054b9 100644 --- a/PowerEditor/src/lastRecentFileList.cpp +++ b/PowerEditor/src/lastRecentFileList.cpp @@ -90,7 +90,7 @@ void LastRecentFileList::updateMenu() //add separators NativeLangSpeaker *pNativeLangSpeaker = nppParam.getNativeLangSpeaker(); - generic_string recentFileList = pNativeLangSpeaker->getSpecialMenuEntryName("RecentFiles"); + generic_string recentFileList = pNativeLangSpeaker->getSubMenuEntryName("file-recentFiles"); generic_string openRecentClosedFile = pNativeLangSpeaker->getNativeLangMenuString(IDM_FILE_RESTORELASTCLOSEDFILE); generic_string openAllFiles = pNativeLangSpeaker->getNativeLangMenuString(IDM_OPEN_ALL_RECENT_FILE); generic_string cleanFileList = pNativeLangSpeaker->getNativeLangMenuString(IDM_CLEAN_RECENT_FILE_LIST); diff --git a/PowerEditor/src/localization.cpp b/PowerEditor/src/localization.cpp index d71c8b52a..64f560ef1 100644 --- a/PowerEditor/src/localization.cpp +++ b/PowerEditor/src/localization.cpp @@ -144,14 +144,14 @@ void NativeLangSpeaker::init(TiXmlDocumentA *nativeLangDocRootA, bool loadIfEngl } } -generic_string NativeLangSpeaker::getSpecialMenuEntryName(const char *entryName) const +generic_string NativeLangSpeaker::getSubMenuEntryName(const char *nodeName) const { if (!_nativeLangA) return TEXT(""); TiXmlNodeA *mainMenu = _nativeLangA->FirstChild("Menu"); if (!mainMenu) return TEXT(""); mainMenu = mainMenu->FirstChild("Main"); if (!mainMenu) return TEXT(""); - TiXmlNodeA *entriesRoot = mainMenu->FirstChild("Entries"); + TiXmlNodeA *entriesRoot = mainMenu->FirstChild("SubEntries"); if (!entriesRoot) return TEXT(""); WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance(); @@ -162,11 +162,11 @@ generic_string NativeLangSpeaker::getSpecialMenuEntryName(const char *entryName) { TiXmlElementA *element = childNode->ToElement(); - const char *idName = element->Attribute("idName"); + const char *idName = element->Attribute("subMenuId"); if (idName) { const char *name = element->Attribute("name"); - if (!strcmp(idName, entryName)) + if (!strcmp(idName, nodeName)) { return wmc.char2wchar(name, _nativeLangEncoding); } diff --git a/PowerEditor/src/localization.h b/PowerEditor/src/localization.h index c299ee0d2..b93a1227c 100644 --- a/PowerEditor/src/localization.h +++ b/PowerEditor/src/localization.h @@ -45,7 +45,7 @@ public: TiXmlNodeA * searchDlgNode(TiXmlNodeA *node, const char *dlgTagName); bool changeDlgLang(HWND hDlg, const char *dlgTagName, char *title = NULL, size_t titleMaxSize = 0); void changeLangTabDropContextMenu(HMENU hCM); - generic_string getSpecialMenuEntryName(const char *entryName) const; + generic_string getSubMenuEntryName(const char *nodeName) const; generic_string getNativeLangMenuString(int itemID) const; generic_string getShortcutNameString(int itemID) const;