mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-28 00:04:25 +02:00
Make Incremental Search panel translatable
Fix also checkbox overlap in incremental search bar. Fix #8955, fix #8574, close #10420
This commit is contained in:
parent
deab93f9b5
commit
e12b161d48
@ -431,6 +431,12 @@ The comments are here for explanation, it's not necessary to translate them.
|
|||||||
<Item id="1725" name="Copy Marked Text"/>
|
<Item id="1725" name="Copy Marked Text"/>
|
||||||
</Find>
|
</Find>
|
||||||
|
|
||||||
|
<IncrementalFind title="">
|
||||||
|
<Item id="1681" name="Find"/>
|
||||||
|
<Item id="1685" name="Match case"/>
|
||||||
|
<Item id="1690" name="Highlight all"/>
|
||||||
|
</IncrementalFind>
|
||||||
|
|
||||||
<FindCharsInRange title="Find Characters in Range...">
|
<FindCharsInRange title="Find Characters in Range...">
|
||||||
<Item id="2" name="Close"/>
|
<Item id="2" name="Close"/>
|
||||||
<Item id="2901" name="Non-ASCII Characters (128-255)"/>
|
<Item id="2901" name="Non-ASCII Characters (128-255)"/>
|
||||||
@ -1472,6 +1478,10 @@ Find in all files except exe, obj && log:
|
|||||||
<tab-untitled-string value="new " />
|
<tab-untitled-string value="new " />
|
||||||
<file-save-assign-type value="&Append extension" />
|
<file-save-assign-type value="&Append extension" />
|
||||||
<close-panel-tip value="Close" />
|
<close-panel-tip value="Close" />
|
||||||
|
<IncrementalFind-FSFound value="$INT_REPLACE$ matches" />
|
||||||
|
<IncrementalFind-FSNotFound value="Phrase not found" />
|
||||||
|
<IncrementalFind-FSTopReached value="Reached top of page, continued from bottom" />
|
||||||
|
<IncrementalFind-FSEndReached value="Reached end of page, continued from top" />
|
||||||
</MiscStrings>
|
</MiscStrings>
|
||||||
</Native-Langue>
|
</Native-Langue>
|
||||||
</NotepadPlus>
|
</NotepadPlus>
|
||||||
|
@ -427,7 +427,11 @@
|
|||||||
<Item id="1721" name="▲"/>
|
<Item id="1721" name="▲"/>
|
||||||
<Item id="1723" name="▼ Suivant"/>
|
<Item id="1723" name="▼ Suivant"/>
|
||||||
</Find>
|
</Find>
|
||||||
|
<IncrementalFind title="">
|
||||||
|
<Item id="1681" name="Rechercher :"/>
|
||||||
|
<Item id="1685" name="Sensible à la casse"/>
|
||||||
|
<Item id="1690" name="Surligner tout"/>
|
||||||
|
</IncrementalFind>
|
||||||
<FindCharsInRange title="Rechercher des caractères dans une plage">
|
<FindCharsInRange title="Rechercher des caractères dans une plage">
|
||||||
<Item id="2" name="Fermer"/>
|
<Item id="2" name="Fermer"/>
|
||||||
<Item id="2901" name="Caractères non-ASCII (128-255)"/>
|
<Item id="2901" name="Caractères non-ASCII (128-255)"/>
|
||||||
@ -1434,6 +1438,10 @@ Rechercher dans tous les fichiers sauf exe, obj && log:
|
|||||||
<find-regex-zero-length-match value="la chaîne vide trouvée" />
|
<find-regex-zero-length-match value="la chaîne vide trouvée" />
|
||||||
<session-save-folder-as-workspace value=""Dossier en tant qu'espace de travail" inclus" />
|
<session-save-folder-as-workspace value=""Dossier en tant qu'espace de travail" inclus" />
|
||||||
<tab-untitled-string value="nouveau " />
|
<tab-untitled-string value="nouveau " />
|
||||||
|
<IncrementalFind-FSFound value="$INT_REPLACE$ correspondances" />
|
||||||
|
<IncrementalFind-FSNotFound value="Expression introuvable" />
|
||||||
|
<IncrementalFind-FSTopReached value="Haut de page atteint, continuer en partant du bas" />
|
||||||
|
<IncrementalFind-FSEndReached value="Fin de page atteinte, continuer en partant du haut" />
|
||||||
</MiscStrings>
|
</MiscStrings>
|
||||||
</Native-Langue>
|
</Native-Langue>
|
||||||
</NotepadPlus>
|
</NotepadPlus>
|
||||||
|
@ -426,7 +426,12 @@
|
|||||||
<Item id="1723" name="▼ 找下一個"/>
|
<Item id="1723" name="▼ 找下一個"/>
|
||||||
<Item id="1725" name="複製標記文字"/>
|
<Item id="1725" name="複製標記文字"/>
|
||||||
</Find>
|
</Find>
|
||||||
<FindCharsInRange title="以字元編號搜尋字元">
|
<IncrementalFind title="">
|
||||||
|
<Item id="1681" name="搜尋:"/>
|
||||||
|
<Item id="1685" name="區分大小寫"/>
|
||||||
|
<Item id="1690" name="醒目提示所有"/>
|
||||||
|
</IncrementalFind>
|
||||||
|
<FindCharsInRange title="以字元編號搜尋字元">
|
||||||
<Item id="2" name="關閉"/>
|
<Item id="2" name="關閉"/>
|
||||||
<Item id="2901" name="非 ASCII 字元(128-255)"/>
|
<Item id="2901" name="非 ASCII 字元(128-255)"/>
|
||||||
<Item id="2902" name="ASCII 字元(0-127)"/>
|
<Item id="2902" name="ASCII 字元(0-127)"/>
|
||||||
@ -1424,6 +1429,10 @@
|
|||||||
<find-regex-zero-length-match value="零長度的字元相符" />
|
<find-regex-zero-length-match value="零長度的字元相符" />
|
||||||
<session-save-folder-as-workspace value="包含「資料夾工作區」" />
|
<session-save-folder-as-workspace value="包含「資料夾工作區」" />
|
||||||
<tab-untitled-string value="新文件 " />
|
<tab-untitled-string value="新文件 " />
|
||||||
|
<IncrementalFind-FSFound value="$INT_REPLACE$ 相符" />
|
||||||
|
<IncrementalFind-FSNotFound value="找不到相符字串" />
|
||||||
|
<IncrementalFind-FSTopReached value="到達頁面頂部,從底部繼續" />
|
||||||
|
<IncrementalFind-FSEndReached value="到達頁面末尾,從頂部繼續 " />
|
||||||
</MiscStrings>
|
</MiscStrings>
|
||||||
</Native-Langue>
|
</Native-Langue>
|
||||||
</NotepadPlus>
|
</NotepadPlus>
|
||||||
|
@ -6498,6 +6498,11 @@ bool Notepad_plus::reloadLang()
|
|||||||
_nativeLangSpeaker.changeDlgLang(_runMacroDlg.getHSelf(), "MultiMacro");
|
_nativeLangSpeaker.changeDlgLang(_runMacroDlg.getHSelf(), "MultiMacro");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_incrementFindDlg.isCreated())
|
||||||
|
{
|
||||||
|
_nativeLangSpeaker.changeDlgLang(_incrementFindDlg.getHSelf(), "IncrementalFind");
|
||||||
|
}
|
||||||
|
|
||||||
if (_findCharsInRangeDlg.isCreated())
|
if (_findCharsInRangeDlg.isCreated())
|
||||||
{
|
{
|
||||||
_nativeLangSpeaker.changeDlgLang(_findCharsInRangeDlg.getHSelf(), "FindCharsInRange");
|
_nativeLangSpeaker.changeDlgLang(_findCharsInRangeDlg.getHSelf(), "FindCharsInRange");
|
||||||
|
@ -1172,6 +1172,10 @@ void Notepad_plus::command(int id)
|
|||||||
const int strSize = FINDREPLACE_MAXLENGTH;
|
const int strSize = FINDREPLACE_MAXLENGTH;
|
||||||
TCHAR str[strSize];
|
TCHAR str[strSize];
|
||||||
|
|
||||||
|
bool isFirstTime = !_incrementFindDlg.isCreated();
|
||||||
|
if (isFirstTime)
|
||||||
|
_nativeLangSpeaker.changeDlgLang(_incrementFindDlg.getHSelf(), "IncrementalFind");
|
||||||
|
|
||||||
_pEditView->getGenericSelectedText(str, strSize, false);
|
_pEditView->getGenericSelectedText(str, strSize, false);
|
||||||
if (0 != str[0]) // the selected text is not empty, then use it
|
if (0 != str[0]) // the selected text is not empty, then use it
|
||||||
_incrementFindDlg.setSearchText(str, _pEditView->getCurrentBuffer()->getUnicodeMode() != uni8Bit);
|
_incrementFindDlg.setSearchText(str, _pEditView->getCurrentBuffer()->getUnicodeMode() != uni8Bit);
|
||||||
|
@ -4717,20 +4717,55 @@ void FindIncrementDlg::markSelectedTextInc(bool enable, FindOption *opt)
|
|||||||
|
|
||||||
void FindIncrementDlg::setFindStatus(FindStatus iStatus, int nbCounted)
|
void FindIncrementDlg::setFindStatus(FindStatus iStatus, int nbCounted)
|
||||||
{
|
{
|
||||||
static TCHAR findCount[128] = TEXT("");
|
generic_string statusStr2Display;
|
||||||
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());
|
|
||||||
|
|
||||||
if (iStatus<0 || iStatus >= sizeof(findStatus)/sizeof(findStatus[0]))
|
static const TCHAR* const strFSNotFound = TEXT("Phrase not found");
|
||||||
return; // out of range
|
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;
|
_findStatus = iStatus;
|
||||||
|
|
||||||
@ -4739,7 +4774,8 @@ void FindIncrementDlg::setFindStatus(FindStatus iStatus, int nbCounted)
|
|||||||
|
|
||||||
// invalidate the editor rect
|
// invalidate the editor rect
|
||||||
::InvalidateRect(hEditor, NULL, TRUE);
|
::InvalidateRect(hEditor, NULL, TRUE);
|
||||||
::SendDlgItemMessage(_hSelf, IDC_INCFINDSTATUS, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(findStatus[iStatus]));
|
|
||||||
|
::SendDlgItemMessage(_hSelf, IDC_INCFINDSTATUS, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(statusStr2Display.c_str()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void FindIncrementDlg::addToRebar(ReBar * rebar)
|
void FindIncrementDlg::addToRebar(ReBar * rebar)
|
||||||
|
@ -87,18 +87,18 @@ END
|
|||||||
|
|
||||||
IDB_INCREMENTAL_BG BITMAP "../icons/incrementalBg.bmp"
|
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
|
STYLE DS_SYSMODAL | DS_CONTROL | DS_FIXEDSYS | WS_CHILD | WS_CLIPCHILDREN
|
||||||
FONT 8, TEXT("MS Shell Dlg")
|
FONT 8, TEXT("MS Shell Dlg")
|
||||||
BEGIN
|
BEGIN
|
||||||
PUSHBUTTON "X",IDCANCEL,2,3,16,14
|
PUSHBUTTON "X",IDCANCEL,2,3,16,14
|
||||||
RTEXT "Find :",IDC_INCSTATIC,20,6,25,12
|
RTEXT "Find:",IDC_INCSTATIC,18,6,46,12
|
||||||
EDITTEXT IDC_INCFINDTEXT,45,6,175,10,ES_AUTOHSCROLL | ES_WANTRETURN | NOT WS_BORDER | WS_TABSTOP
|
EDITTEXT IDC_INCFINDTEXT,65,6,175,10,ES_AUTOHSCROLL | ES_WANTRETURN | NOT WS_BORDER | WS_TABSTOP
|
||||||
PUSHBUTTON "<",IDC_INCFINDPREVOK,223,3,16,14, WS_TABSTOP
|
PUSHBUTTON "<",IDC_INCFINDPREVOK,243,3,16,14, WS_TABSTOP
|
||||||
PUSHBUTTON ">",IDC_INCFINDNXTOK,243,3,16,14, WS_TABSTOP
|
PUSHBUTTON ">",IDC_INCFINDNXTOK,263,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,290,5,100,12
|
||||||
CONTROL "Match &case", IDC_INCFINDMATCHCASE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,335,5,60,12
|
CONTROL "&Highlight all", IDC_INCFINDHILITEALL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,400,5,100,12
|
||||||
LTEXT "",IDC_INCFINDSTATUS,400,6,180,12
|
LTEXT "",IDC_INCFINDSTATUS,520,6,180,12
|
||||||
END
|
END
|
||||||
|
|
||||||
IDD_FINDRESULT DIALOGEX 26, 41, 223, 67
|
IDD_FINDRESULT DIALOGEX 26, 41, 223, 67
|
||||||
|
Loading…
x
Reference in New Issue
Block a user