diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml
index e2d885a47..443f22513 100644
--- a/PowerEditor/installer/nativeLang/english.xml
+++ b/PowerEditor/installer/nativeLang/english.xml
@@ -1,6 +1,6 @@
-
+
diff --git a/PowerEditor/installer/nativeLang/french.xml b/PowerEditor/installer/nativeLang/french.xml
index 94b2b3fb8..7a7ba6625 100644
--- a/PowerEditor/installer/nativeLang/french.xml
+++ b/PowerEditor/installer/nativeLang/french.xml
@@ -1,6 +1,6 @@
-
+
diff --git a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml
index bbcaeaea3..f1e52837f 100644
--- a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml
+++ b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml
@@ -1,6 +1,6 @@
-
+
diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp
index 063500f30..e5a8263e6 100644
--- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp
+++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp
@@ -2260,6 +2260,15 @@ void FindReplaceDlg::findAllIn(InWhat op)
// the dlgDlg should be the index of funcItem where the current function pointer is
// in this case is DOCKABLE_DEMO_INDEX
data.dlgID = 0;
+
+ NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker();
+ generic_string text = pNativeSpeaker->getLocalizedStrFromID("find-result-caption", TEXT(""));
+ if (!text.empty())
+ {
+ _findResTitle = text;
+ data.pszName = _findResTitle.c_str();
+ }
+
::SendMessage(_hParent, NPPM_DMMREGASDCKDLG, 0, reinterpret_cast(&data));
_pFinder->_scintView.init(_hInst, _pFinder->getHSelf());
@@ -2314,10 +2323,9 @@ void FindReplaceDlg::findAllIn(InWhat op)
if (::SendMessage(_hParent, cmdid, 0, 0))
{
- if (_findAllResult == 1)
- wsprintf(_findAllResultStr, TEXT("1 hit"));
- else
- wsprintf(_findAllResultStr, TEXT("%s hits"), commafyInt(_findAllResult).c_str());
+ generic_string text = _pFinder->getHitsString(_findAllResult);
+ wsprintf(_findAllResultStr, text.c_str());
+
if (_findAllResult)
{
focusOnFinder();
@@ -2352,6 +2360,15 @@ Finder * FindReplaceDlg::createFinder()
// the dlgDlg should be the index of funcItem where the current function pointer is
// in this case is DOCKABLE_DEMO_INDEX
data.dlgID = 0;
+
+ NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker();
+ generic_string text = pNativeSpeaker->getLocalizedStrFromID("find-result-caption", TEXT(""));
+ if (!text.empty())
+ {
+ _findResTitle = text;
+ data.pszName = _findResTitle.c_str();
+ }
+
::SendMessage(_hParent, NPPM_DMMREGASDCKDLG, 0, reinterpret_cast(&data));
pFinder->_scintView.init(_hInst, pFinder->getHSelf());
@@ -2388,6 +2405,17 @@ Finder * FindReplaceDlg::createFinder()
pFinder->_scintView.execute(SCI_SETPROPERTY, reinterpret_cast("@MarkingsStruct"), reinterpret_cast(ptrword));
_findersOfFinder.push_back(pFinder);
+ /*
+ NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker();
+ generic_string title_temp = pNativeSpeaker->getAttrNameStr(FS_PROJECTPANELTITLE, "DocSwitcher", "PanelTitle");
+ static TCHAR title[32];
+ if (title_temp.length() < 32)
+ {
+ wcscpy_s(title, title_temp.c_str());
+ data.pszName = title;
+ }
+ */
+
::SendMessage(pFinder->getHSelf(), WM_SIZE, 0, 0);
@@ -3101,11 +3129,39 @@ bool FindReplaceDlg::replaceInFilesConfirmCheck(generic_string directory, generi
return confirmed;
}
+generic_string Finder::getHitsString(int count) const
+{
+ NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker();
+ generic_string text = pNativeSpeaker->getLocalizedStrFromID("find-result-hits", TEXT(""));
+
+ if (text.empty())
+ {
+ if (count == 1)
+ {
+ text = TEXT(" (1 hit)");
+ }
+ else
+ {
+ text = TEXT(" (");
+ text += std::to_wstring(count);
+ text += TEXT(" hits)");
+ }
+ }
+ else
+ {
+ text = stringReplace(text, TEXT("$INT_REPLACE$"), std::to_wstring(count));
+ }
+
+ return text;
+}
+
void Finder::addSearchLine(const TCHAR *searchName)
{
- generic_string str = TEXT("Search \"");
+ NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker();
+ generic_string str = pNativeSpeaker->getLocalizedStrFromID("find-result-title", TEXT("Search"));
+ str += TEXT(" \"");
str += searchName;
- str += TEXT("\"\r\n");
+ str += TEXT("\" \r\n");
setFinderReadOnly(false);
_scintView.addGenericText(str.c_str());
@@ -3133,31 +3189,72 @@ void Finder::addFileNameTitle(const TCHAR * fileName)
void Finder::addFileHitCount(int count)
{
- TCHAR text[20];
- if (count == 1)
- wsprintf(text, TEXT(" (1 hit)"));
- else
- wsprintf(text, TEXT(" (%i hits)"), count);
+ wstring text = TEXT(" ");
+ text += getHitsString(count);
setFinderReadOnly(false);
- _scintView.insertGenericTextFrom(_lastFileHeaderPos, text);
+ _scintView.insertGenericTextFrom(_lastFileHeaderPos, text.c_str());
setFinderReadOnly(true);
++_nbFoundFiles;
}
void Finder::addSearchHitCount(int count, int countSearched, bool isMatchLines)
{
- const TCHAR *moreInfo = isMatchLines ? TEXT(" - Line Filter Mode: only display the filtered results") :TEXT("");
- TCHAR text[100];
- if (count == 1 && _nbFoundFiles == 1)
- wsprintf(text, TEXT(" (1 hit in 1 file of %i searched%s)"), countSearched, moreInfo);
- else if (count == 1 && _nbFoundFiles != 1)
- wsprintf(text, TEXT(" (1 hit in %i files of %i searched%s)"), _nbFoundFiles, countSearched, moreInfo);
- else if (count != 1 && _nbFoundFiles == 1)
- wsprintf(text, TEXT(" (%i hits in 1 file of %i searched%s)"), count, countSearched, moreInfo);
- else if (count != 1 && _nbFoundFiles != 1)
- wsprintf(text, TEXT(" (%i hits in %i files of %i searched%s)"), count, _nbFoundFiles, countSearched, moreInfo);
+ generic_string hitIn;
+ generic_string fileOf;
+
+ generic_string nbResStr = std::to_wstring(count);
+ generic_string nbFoundFilesStr = std::to_wstring(_nbFoundFiles);
+ generic_string nbSearchedFilesStr = std::to_wstring(countSearched);
+
+ NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker();
+ generic_string text = pNativeSpeaker->getLocalizedStrFromID("find-result-title-info", TEXT(""));
+
+ if (text.empty())
+ {
+ if (count == 1 && _nbFoundFiles == 1)
+ {
+ hitIn = TEXT(" hit in ");
+ fileOf = TEXT(" file of ");
+ }
+ else if (count == 1 && _nbFoundFiles != 1)
+ {
+ hitIn = TEXT(" hit in ");
+ fileOf = TEXT(" files of ");
+ }
+ else if (count != 1 && _nbFoundFiles == 1)
+ {
+ hitIn = TEXT(" hits in ");
+ fileOf = TEXT(" file of ");
+ }
+ else //if (count != 1 && _nbFoundFiles != 1)
+ {
+ hitIn = TEXT(" hits in ");
+ fileOf = TEXT(" files of ");
+ }
+
+ const TCHAR *moreInfo = isMatchLines ? TEXT(" - Line Filter Mode: only display the filtered results") : TEXT("");
+
+ text = TEXT(" (");
+ text += nbResStr;
+ text += hitIn;
+ text += nbFoundFilesStr;
+ text += fileOf;
+ text += nbSearchedFilesStr;
+ text += TEXT(" searched");
+ text += moreInfo;
+ text += TEXT(")");
+ }
+ else
+ {
+ text = stringReplace(text, TEXT("$INT_REPLACE1$"), nbResStr);
+ text = stringReplace(text, TEXT("$INT_REPLACE2$"), nbFoundFilesStr);
+ text = stringReplace(text, TEXT("$INT_REPLACE3$"), nbSearchedFilesStr);
+
+ text += isMatchLines ? pNativeSpeaker->getLocalizedStrFromID("find-result-title-info-extra", TEXT("")) : TEXT("");
+ }
+
setFinderReadOnly(false);
- _scintView.insertGenericTextFrom(_lastSearchHeaderPos, text);
+ _scintView.insertGenericTextFrom(_lastSearchHeaderPos, text.c_str());
setFinderReadOnly(true);
}
diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h
index c52fe51ab..6409c357a 100644
--- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h
+++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h
@@ -139,6 +139,7 @@ public:
std::vector getResultFilePaths() const;
bool canFind(const TCHAR *fileName, size_t lineNumber) const;
void setVolatiled(bool val) { _canBeVolatiled = val; };
+ generic_string getHitsString(int count) const;
protected :
virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
@@ -146,7 +147,7 @@ protected :
private:
- enum { searchHeaderLevel = SC_FOLDLEVELBASE + 1, fileHeaderLevel, resultLevel };
+ enum { searchHeaderLevel = SC_FOLDLEVELBASE, fileHeaderLevel, resultLevel };
ScintillaEditView **_ppEditView = nullptr;
std::vector _foundInfos1;
@@ -357,6 +358,7 @@ private :
ScintillaEditView **_ppEditView = nullptr;
Finder *_pFinder = nullptr;
+ generic_string _findResTitle;
std::vector _findersOfFinder;
diff --git a/scintilla/lexers/LexSearchResult.cxx b/scintilla/lexers/LexSearchResult.cxx
index 15ecaa5d2..b8105d5ae 100644
--- a/scintilla/lexers/LexSearchResult.cxx
+++ b/scintilla/lexers/LexSearchResult.cxx
@@ -40,7 +40,7 @@
using namespace Scintilla;
// The following definitions are a copy of the ones in FindReplaceDlg.h
-enum { searchHeaderLevel = SC_FOLDLEVELBASE + 1, fileHeaderLevel, resultLevel };
+enum { searchHeaderLevel = SC_FOLDLEVELBASE, fileHeaderLevel, resultLevel };
static inline bool AtEOL(Accessor &styler, size_t i) {
@@ -56,15 +56,11 @@ static void ColouriseSearchResultLine(SearchResultMarkings* pMarkings, char *lin
{
// startLine and endPos are the absolute positions.
- if (lineBuffer[0] == ' ') // file header
+ if (lineBuffer[0] == ' ') // white space - file header
{
styler.ColourTo(endPos, SCE_SEARCHRESULT_FILE_HEADER);
}
- else if (lineBuffer[0] == 'S') // search header
- {
- styler.ColourTo(endPos, SCE_SEARCHRESULT_SEARCH_HEADER);
- }
- else // line info
+ else if (lineBuffer[0] == ' ')// \t - line info
{
const unsigned int firstTokenLen = 4;
unsigned int currentPos;
@@ -95,6 +91,10 @@ static void ColouriseSearchResultLine(SearchResultMarkings* pMarkings, char *lin
}
styler.ColourTo(endPos, currentStat);
}
+ else // every character - search header
+ {
+ styler.ColourTo(endPos, SCE_SEARCHRESULT_SEARCH_HEADER);
+ }
}
static void ColouriseSearchResultDoc(Sci_PositionU startPos, Sci_Position length, int, WordList *[], Accessor &styler) {