diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml index b78ada67e..dbe1e5deb 100644 --- a/PowerEditor/installer/nativeLang/english.xml +++ b/PowerEditor/installer/nativeLang/english.xml @@ -431,6 +431,12 @@ The comments are here for explanation, it's not necessary to translate them. + + + + + + @@ -1472,6 +1478,10 @@ Find in all files except exe, obj && log: + + + + diff --git a/PowerEditor/installer/nativeLang/french.xml b/PowerEditor/installer/nativeLang/french.xml index 9cf5deaa3..7808d3f63 100644 --- a/PowerEditor/installer/nativeLang/french.xml +++ b/PowerEditor/installer/nativeLang/french.xml @@ -427,7 +427,11 @@ - + + + + + @@ -1434,6 +1438,10 @@ Rechercher dans tous les fichiers sauf exe, obj && log: + + + + diff --git a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml index 3d0c33f24..456cba8ae 100644 --- a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml +++ b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml @@ -426,7 +426,12 @@ - + + + + + + @@ -1424,6 +1429,10 @@ + + + + diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index f2833d99f..94d20d72e 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -6498,6 +6498,11 @@ bool Notepad_plus::reloadLang() _nativeLangSpeaker.changeDlgLang(_runMacroDlg.getHSelf(), "MultiMacro"); } + if (_incrementFindDlg.isCreated()) + { + _nativeLangSpeaker.changeDlgLang(_incrementFindDlg.getHSelf(), "IncrementalFind"); + } + if (_findCharsInRangeDlg.isCreated()) { _nativeLangSpeaker.changeDlgLang(_findCharsInRangeDlg.getHSelf(), "FindCharsInRange"); diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index aca23d309..26eea7ca0 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -1172,6 +1172,10 @@ void Notepad_plus::command(int id) const int strSize = FINDREPLACE_MAXLENGTH; TCHAR str[strSize]; + bool isFirstTime = !_incrementFindDlg.isCreated(); + if (isFirstTime) + _nativeLangSpeaker.changeDlgLang(_incrementFindDlg.getHSelf(), "IncrementalFind"); + _pEditView->getGenericSelectedText(str, strSize, false); if (0 != str[0]) // the selected text is not empty, then use it _incrementFindDlg.setSearchText(str, _pEditView->getCurrentBuffer()->getUnicodeMode() != uni8Bit); diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index 0b6656e79..8a45ad118 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -4717,20 +4717,55 @@ void FindIncrementDlg::markSelectedTextInc(bool enable, FindOption *opt) void FindIncrementDlg::setFindStatus(FindStatus iStatus, int nbCounted) { - static TCHAR findCount[128] = TEXT(""); - static const TCHAR * const findStatus[] = { findCount, // FSFound - TEXT("Phrase not found"), //FSNotFound - TEXT("Reached top of page, continued from bottom"), // FSTopReached - TEXT("Reached end of page, continued from top")}; // FSEndReached - if (nbCounted <= 0) - findCount[0] = '\0'; - else if (nbCounted == 1) - wsprintf(findCount, TEXT("%d match."), nbCounted); - else - wsprintf(findCount, TEXT("%s matches."), commafyInt(nbCounted).c_str()); + generic_string statusStr2Display; - if (iStatus<0 || iStatus >= sizeof(findStatus)/sizeof(findStatus[0])) - return; // out of range + static const TCHAR* const strFSNotFound = TEXT("Phrase not found"); + static const TCHAR* const strFSTopReached = TEXT("Reached top of page, continued from bottom"); + static const TCHAR* const strFSEndReached = TEXT("Reached end of page, continued from top"); + + NativeLangSpeaker* pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker(); + + if (nbCounted >= 0) + { + statusStr2Display = pNativeSpeaker->getLocalizedStrFromID("IncrementalFind-FSFound", TEXT("")); + + if (statusStr2Display.empty()) + { + TCHAR strFindFSFound[128] = TEXT(""); + + if (nbCounted == 1) + wsprintf(strFindFSFound, TEXT("%d match"), nbCounted); + else + wsprintf(strFindFSFound, TEXT("%s matches"), commafyInt(nbCounted).c_str()); + statusStr2Display = strFindFSFound; + } + else + { + statusStr2Display = stringReplace(statusStr2Display, TEXT("$INT_REPLACE$"), std::to_wstring(nbCounted)); + } + } + + + switch (iStatus) + { + case FindStatus::FSNotFound: + statusStr2Display = pNativeSpeaker->getLocalizedStrFromID("IncrementalFind-FSNotFound", strFSNotFound); + break; + + case FindStatus::FSTopReached: + statusStr2Display = pNativeSpeaker->getLocalizedStrFromID("IncrementalFind-FSTopReached", strFSTopReached); + break; + + case FindStatus::FSEndReached: + statusStr2Display = pNativeSpeaker->getLocalizedStrFromID("IncrementalFind-FSEndReached", strFSEndReached); + break; + + case FindStatus::FSFound: + break; + + default: + return; // out of range + } _findStatus = iStatus; @@ -4739,7 +4774,8 @@ void FindIncrementDlg::setFindStatus(FindStatus iStatus, int nbCounted) // invalidate the editor rect ::InvalidateRect(hEditor, NULL, TRUE); - ::SendDlgItemMessage(_hSelf, IDC_INCFINDSTATUS, WM_SETTEXT, 0, reinterpret_cast(findStatus[iStatus])); + + ::SendDlgItemMessage(_hSelf, IDC_INCFINDSTATUS, WM_SETTEXT, 0, reinterpret_cast(statusStr2Display.c_str())); } void FindIncrementDlg::addToRebar(ReBar * rebar) diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.rc b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.rc index 5a1f910f5..df104d715 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.rc +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.rc @@ -87,18 +87,18 @@ END IDB_INCREMENTAL_BG BITMAP "../icons/incrementalBg.bmp" -IDD_INCREMENT_FIND DIALOGEX 0, 0, 400, 20 +IDD_INCREMENT_FIND DIALOGEX 0, 0, 680, 20 STYLE DS_SYSMODAL | DS_CONTROL | DS_FIXEDSYS | WS_CHILD | WS_CLIPCHILDREN FONT 8, TEXT("MS Shell Dlg") BEGIN PUSHBUTTON "X",IDCANCEL,2,3,16,14 - RTEXT "Find :",IDC_INCSTATIC,20,6,25,12 - EDITTEXT IDC_INCFINDTEXT,45,6,175,10,ES_AUTOHSCROLL | ES_WANTRETURN | NOT WS_BORDER | WS_TABSTOP - PUSHBUTTON "<",IDC_INCFINDPREVOK,223,3,16,14, WS_TABSTOP - PUSHBUTTON ">",IDC_INCFINDNXTOK,243,3,16,14, WS_TABSTOP - CONTROL "&Highlight all", IDC_INCFINDHILITEALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,270,5,65,12 - CONTROL "Match &case", IDC_INCFINDMATCHCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,335,5,60,12 - LTEXT "",IDC_INCFINDSTATUS,400,6,180,12 + RTEXT "Find:",IDC_INCSTATIC,18,6,46,12 + EDITTEXT IDC_INCFINDTEXT,65,6,175,10,ES_AUTOHSCROLL | ES_WANTRETURN | NOT WS_BORDER | WS_TABSTOP + PUSHBUTTON "<",IDC_INCFINDPREVOK,243,3,16,14, WS_TABSTOP + PUSHBUTTON ">",IDC_INCFINDNXTOK,263,3,16,14, WS_TABSTOP + CONTROL "Match &case", IDC_INCFINDMATCHCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,290,5,100,12 + CONTROL "&Highlight all", IDC_INCFINDHILITEALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,400,5,100,12 + LTEXT "",IDC_INCFINDSTATUS,520,6,180,12 END IDD_FINDRESULT DIALOGEX 26, 41, 223, 67