From 78c6554e9157f7b114b60ba797407b9ae431db37 Mon Sep 17 00:00:00 2001 From: mere-human <9664141+mere-human@users.noreply.github.com> Date: Fri, 7 Jan 2022 13:01:48 +0200 Subject: [PATCH] Add missing translation for folder browser title Affected places: File > Open Folder as Workspace Search > Find in Files Settings > Preferences > Default Directory > [...] Settings > Preferences > Backup > [...] Fix #10983, fix #10984, fix #10985, close #11005 --- PowerEditor/installer/nativeLang/english.xml | 3 +++ PowerEditor/src/NppCommands.cpp | 5 ++++- PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp | 6 +++++- .../src/WinControls/FileBrowser/fileBrowser.cpp | 2 +- .../src/WinControls/Preference/preferenceDlg.cpp | 10 ++++++++-- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml index 4f814634a..7ae6a7485 100644 --- a/PowerEditor/installer/nativeLang/english.xml +++ b/PowerEditor/installer/nativeLang/english.xml @@ -1390,9 +1390,11 @@ Continue?"/> + + @@ -1407,6 +1409,7 @@ Find in all files but exclude folders tests, bin && bin64: Find in all files but exclude all folders log or logs recursively: *.* !+\log*"/> + diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index 0b234a09f..4d76adb4b 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -183,7 +183,10 @@ void Notepad_plus::command(int id) case IDM_FILE_OPENFOLDERASWORSPACE: { - generic_string folderPath = folderBrowser(_pPublicInterface->getHSelf(), TEXT("Select a folder to add in Folder as Workspace panel")); + NativeLangSpeaker* pNativeSpeaker = NppParameters::getInstance().getNativeLangSpeaker(); + generic_string openWorkspaceStr = pNativeSpeaker->getAttrNameStr(TEXT("Select a folder to add in Folder as Workspace panel"), + FOLDERASWORKSPACE_NODE, "SelectFolderFromBrowserString"); + generic_string folderPath = folderBrowser(_pPublicInterface->getHSelf(), openWorkspaceStr); if (!folderPath.empty()) { if (_pFileBrowser == nullptr) // first launch, check in params to open folders diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index 8f6e5bb0b..36cb47fa5 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -1840,7 +1840,11 @@ INT_PTR CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM case IDD_FINDINFILES_BROWSE_BUTTON : { if (_currentStatus == FINDINFILES_DLG) - folderBrowser(_hSelf, TEXT("Select a folder to search from"), IDD_FINDINFILES_DIR_COMBO, _options._directory.c_str()); + { + NativeLangSpeaker* pNativeSpeaker = NppParameters::getInstance().getNativeLangSpeaker(); + const generic_string title = pNativeSpeaker->getLocalizedStrFromID("find-in-files-select-folder", TEXT("Select a folder to search from")); + folderBrowser(_hSelf, title, IDD_FINDINFILES_DIR_COMBO, _options._directory.c_str()); + } } return TRUE; diff --git a/PowerEditor/src/WinControls/FileBrowser/fileBrowser.cpp b/PowerEditor/src/WinControls/FileBrowser/fileBrowser.cpp index 424188e07..a5f814d4b 100644 --- a/PowerEditor/src/WinControls/FileBrowser/fileBrowser.cpp +++ b/PowerEditor/src/WinControls/FileBrowser/fileBrowser.cpp @@ -863,7 +863,7 @@ void FileBrowser::popupMenuCmd(int cmdID) { NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker(); generic_string openWorkspaceStr = pNativeSpeaker->getAttrNameStr(TEXT("Select a folder to add in Folder as Workspace panel"), FOLDERASWORKSPACE_NODE, "SelectFolderFromBrowserString"); - generic_string folderPath = folderBrowser(_hParent, openWorkspaceStr.c_str()); + generic_string folderPath = folderBrowser(_hParent, openWorkspaceStr); if (!folderPath.empty()) { addRootFolder(folderPath); diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index e7fde9625..2d6c7fdd8 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -2169,7 +2169,11 @@ INT_PTR CALLBACK DefaultDirectorySubDlg::run_dlgProc(UINT message, WPARAM wParam return TRUE; case IDD_OPENSAVEDIR_ALWAYSON_BROWSE_BUTTON : - folderBrowser(_hSelf, TEXT("Select a folder as default directory"), IDC_OPENSAVEDIR_ALWAYSON_EDIT); + { + generic_string title = nppParam.getNativeLangSpeaker()->getLocalizedStrFromID("default-open-save-select-folder", + TEXT("Select a folder as default directory")); + folderBrowser(_hSelf, title, IDC_OPENSAVEDIR_ALWAYSON_EDIT); + } return TRUE; case IDC_OPENSAVEDIR_CHECK_DRROPFOLDEROPENFILES: @@ -3485,7 +3489,9 @@ INT_PTR CALLBACK BackupSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM l } case IDD_BACKUPDIR_BROWSE_BUTTON : { - folderBrowser(_hSelf, TEXT("Select a folder as backup directory"), IDC_BACKUPDIR_EDIT); + generic_string title = nppParam.getNativeLangSpeaker()->getLocalizedStrFromID("backup-select-folder", + TEXT("Select a folder as backup directory")); + folderBrowser(_hSelf, title, IDC_BACKUPDIR_EDIT); return TRUE; }