Enhance localization of "Line" of Search result

This enhancement translates "Line" prefix of Search resulton when user change each time the localization.

Inspired from #9233
This commit is contained in:
Don HO 2020-12-09 16:25:35 +01:00
parent 2f6454a085
commit 6c3ecacdb7
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
3 changed files with 6 additions and 6 deletions

View File

@ -3539,10 +3539,8 @@ void Finder::add(FoundInfo fi, SearchResultMarking mi, const TCHAR* foundline)
{ {
_pMainFoundInfos->push_back(fi); _pMainFoundInfos->push_back(fi);
NativeLangSpeaker* pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker();
static generic_string lineStr = pNativeSpeaker->getLocalizedStrFromID("find-result-line-prefix", TEXT("Line"));
generic_string str = TEXT("\t"); generic_string str = TEXT("\t");
str += lineStr; str += _prefixLineStr;
str += TEXT(" "); str += TEXT(" ");
TCHAR lnb[16]; TCHAR lnb[16];
@ -3684,7 +3682,9 @@ void Finder::copy()
void Finder::beginNewFilesSearch() void Finder::beginNewFilesSearch()
{ {
//_scintView.execute(SCI_SETLEXER, SCLEX_NULL); NativeLangSpeaker* pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker();
_prefixLineStr = pNativeSpeaker->getLocalizedStrFromID("find-result-line-prefix", TEXT("Line"));
_scintView.execute(SCI_SETCURRENTPOS, 0); _scintView.execute(SCI_SETCURRENTPOS, 0);
_pMainFoundInfos = _pMainFoundInfos == &_foundInfos1 ? &_foundInfos2 : &_foundInfos1; _pMainFoundInfos = _pMainFoundInfos == &_foundInfos1 ? &_foundInfos2 : &_foundInfos1;

View File

@ -167,9 +167,10 @@ private:
int _lastSearchHeaderPos = 0; int _lastSearchHeaderPos = 0;
bool _canBeVolatiled = true; bool _canBeVolatiled = true;
bool _longLinesAreWrapped = false; bool _longLinesAreWrapped = false;
generic_string _prefixLineStr;
void setFinderReadOnly(bool isReadOnly) { void setFinderReadOnly(bool isReadOnly) {
_scintView.execute(SCI_SETREADONLY, isReadOnly); _scintView.execute(SCI_SETREADONLY, isReadOnly);
}; };

View File

@ -78,7 +78,6 @@ static void ColouriseSearchResultLine(SearchResultMarkings* pMarkings, char *lin
SearchResultMarking mi = pMarkings->_markings[linenum]; SearchResultMarking mi = pMarkings->_markings[linenum];
currentPos += 2; // skip ": "
size_t match_start = startLine + mi._start - 1; size_t match_start = startLine + mi._start - 1;
size_t match_end = startLine + mi._end - 1; size_t match_end = startLine + mi._end - 1;