Make new entries translatable

This commit is contained in:
Don HO 2018-03-02 19:37:10 +01:00
parent 8c84e92349
commit 789cf387df
8 changed files with 223 additions and 191 deletions

View File

@ -928,6 +928,19 @@
<Item id="1" name="編輯"/>
<Item id="2" name="取消"/>
</ColumnEditor>
<FindInFinder title="在搜尋結果中尋找">
<Item id="1" name="尋找全部"/>
<Item id="2" name="關閉"/>
<Item id="1711" name="尋找內容:"/>
<Item id="1713" name="僅在找到的行中進行搜索"/>
<Item id="1714" name="僅符合整個單字(&amp;W)"/>
<Item id="1715" name="區分大小寫(&amp;C)"/>
<Item id="1716" name="搜尋模式"/>
<Item id="1717" name="一般"/>
<Item id="1719" name="規則運算式(&amp;E) "/>
<Item id="1718" name="延伸 (\n, \r, \t, \0, \x...)"/>
<Item id="1720" name="「.」包含換行"/>
</FindInFinder>
</Dialog>
<MessageBox>
<ContextMenuXmlEditWarning title="編輯快顯功能表" message="編輯 contextMenu.xml Notepad++
@ -1139,6 +1152,14 @@
<find-status-replace-not-found value="取代: 找不到搜尋字串"/>
<find-status-replace-readonly value="取代:檔案唯讀,無法取代字串"/>
<find-status-cannot-find value="搜尋: 找不到搜尋字串 &quot;$STR_REPLACE$&quot;"/>
<finder-find-in-finder value="在這搜尋結果中尋找..."/>
<finder-close-this value="關閉這個搜尋結果"/>
<finder-collapse-all value="層數全部收折"/>
<finder-uncollapse-all value="層數全部展開"/>
<finder-copy value="複製"/>
<finder-select-all value="全部選取"/>
<finder-clear-all value="全部清除"/>
<finder-open-all value="全部開啟"/>
</MiscStrings>
</Native-Langue>
</NotepadPlus>

View File

@ -931,6 +931,19 @@
<Item id="1" name="OK"/>
<Item id="2" name="Cancel"/>
</ColumnEditor>
<FindInFinder title="Find in finder">
<Item id="1" name="Find All"/>
<Item id="2" name="Close"/>
<Item id="1711" name="Find what:"/>
<Item id="1713" name="Search only in found lines"/>
<Item id="1714" name="Match &amp;whole word only"/>
<Item id="1715" name="Match &amp;case"/>
<Item id="1716" name="Search mode"/>
<Item id="1717" name="Normal"/>
<Item id="1719" name="Regular &amp;expression"/>
<Item id="1718" name="Extended (\n, \r, \t, \0, \x...)"/>
<Item id="1720" name="&amp;. matches newline"/>
</FindInFinder>
</Dialog>
<MessageBox> <!-- $INT_REPLACE$ is a place holder, don't translate it -->
<ContextMenuXmlEditWarning title="Editing contextMenu" message="Editing contextMenu.xml allows you to modify your Notepad++ popup context menu.
@ -1142,6 +1155,14 @@ please give another one."/>
<find-status-replace-not-found value="Replace: no occurrence was found"/>
<find-status-replace-readonly value="Replace: Cannot replace text. The current document is read only"/>
<find-status-cannot-find value="Find: Can't find the text &quot;$STR_REPLACE$&quot;"/>
<finder-find-in-finder value="Find in this found results..."/>
<finder-close-this value="Close this finder"/>
<finder-collapse-all value="Collapse all"/>
<finder-uncollapse-all value="Uncollapse all"/>
<finder-copy value="Copy"/>
<finder-select-all value="Select all"/>
<finder-clear-all value="Clear all"/>
<finder-open-all value="Open all"/>
</MiscStrings>
</Native-Langue>
</NotepadPlus>

View File

@ -916,6 +916,19 @@
<Item id="2033" name="Nombre à insérer"/>
<Item id="2035" name="Nombre de zéros"/>
</ColumnEditor>
<FindInFinder title="Rechercher dans les résultats trouvés">
<Item id="1" name="Rechercher Tout"/>
<Item id="2" name="Fermer"/>
<Item id="1711" name="Recherche :"/>
<Item id="1713" name="Rechercher dans les lignes trouvées seulement"/>
<Item id="1714" name="Mot entier &amp;uniquement"/>
<Item id="1715" name="Respecter la &amp;casse"/>
<Item id="1716" name="Mode de Recherche"/>
<Item id="1717" name="Mode normal"/>
<Item id="1719" name="&amp;Expression régulière"/>
<Item id="1718" name="Mode étendu (\n, \r, \t, \0, \x...)"/>
<Item id="1720" name="&amp;. comprend ligne nouvelle"/>
</FindInFinder>
</Dialog>
<MessageBox>
<CannotMoveDoc title="Déplacement vers une nouvelle instance Notepad++" message="Le document est en cours d'utilisation, le sauvegarder puis réessayer."/>
@ -1114,6 +1127,14 @@ please give another one."/>
<find-status-replace-not-found value="Remplacer : aucune occurrence a été trouvéé"/>
<find-status-replace-readonly value="Remplacer : l'opération échouée. Le fichier est en lecture seule"/>
<find-status-cannot-find value="Rechercher : &quot;$STR_REPLACE$&quot; n'a pas été trouvé"/>
<finder-find-in-finder value="Rechercher dans les résultats..."/>
<finder-close-this value="Fermer le dialogue des résultats"/>
<finder-collapse-all value="Replier tout"/>
<finder-uncollapse-all value="Déplier tout"/>
<finder-copy value="Copier"/>
<finder-select-all value="Sélectionner tout"/>
<finder-clear-all value="Effacer tout"/>
<finder-open-all value="Ouvrir tout"/>
</MiscStrings>
</Native-Langue>
</NotepadPlus>

View File

@ -2960,7 +2960,7 @@ void Notepad_plus::command(int id)
if (dlgNode)
dlgNode = _nativeLangSpeaker.searchDlgNode(dlgNode, "Window");
}
_windowsDlg.doDialog(dlgNode);
_windowsDlg.doDialog();
}
break;

View File

@ -672,7 +672,11 @@ INT_PTR CALLBACK FindInFinderDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
switch (message)
{
case WM_INITDIALOG:
{
NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance())->getNativeLangSpeaker();
pNativeSpeaker->changeDlgLang(_hSelf, "FindInFinder");
initFromOptions();
}
return TRUE;
case WM_COMMAND:
@ -3257,18 +3261,30 @@ INT_PTR CALLBACK Finder::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
::GetCursorPos(&p);
ContextMenu scintillaContextmenu;
vector<MenuItemUnit> tmp;
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_FINDINFINDERDLG, TEXT("Find in this finder...")));
NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance())->getNativeLangSpeaker();
generic_string findInFinder = pNativeSpeaker->getLocalizedStrFromID("finder-find-in-finder", TEXT("Find in these found results..."));
generic_string closeThis = pNativeSpeaker->getLocalizedStrFromID("finder-close-this", TEXT("Close this finder"));
generic_string collapseAll = pNativeSpeaker->getLocalizedStrFromID("finder-collapse-all", TEXT("Collapse all"));
generic_string uncollapseAll = pNativeSpeaker->getLocalizedStrFromID("finder-uncollapse-all", TEXT("Uncollapse all"));
generic_string copy = pNativeSpeaker->getLocalizedStrFromID("finder-copy", TEXT("Copy"));
generic_string selectAll = pNativeSpeaker->getLocalizedStrFromID("finder-select-all", TEXT("Select all"));
generic_string clearAll = pNativeSpeaker->getLocalizedStrFromID("finder-clear-all", TEXT("Clear all"));
generic_string openAll = pNativeSpeaker->getLocalizedStrFromID("finder-open-all", TEXT("Open all"));
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_FINDINFINDERDLG, findInFinder));
if (_canBeVolatiled)
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_REMOVEFINDER, TEXT("Close this finder")));
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_REMOVEFINDER, closeThis));
tmp.push_back(MenuItemUnit(0, TEXT("Separator")));
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFERCOLLAPSE, TEXT("Collapse all")));
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFERUNCOLLAPSE, TEXT("Uncollapse all")));
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFERCOLLAPSE, collapseAll));
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFERUNCOLLAPSE, uncollapseAll));
tmp.push_back(MenuItemUnit(0, TEXT("Separator")));
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFERCOPY, TEXT("Copy")));
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFERSELECTALL, TEXT("Select all")));
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFERCLEARALL, TEXT("Clear all")));
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFERCOPY, copy));
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFERSELECTALL, selectAll));
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFERCLEARALL, clearAll));
tmp.push_back(MenuItemUnit(0, TEXT("Separator")));
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFEROPENALL, TEXT("Open all")));
tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFEROPENALL, openAll));
scintillaContextmenu.create(_hSelf, tmp);

View File

@ -116,7 +116,7 @@ END
IDD_FINDINFINDER_DLG DIALOGEX 36, 44, 367, 200
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_TOOLWINDOW
CAPTION "Find in finder"
CAPTION "Find in found results"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
BEGIN
RTEXT "&Find what :",IDFINDWHAT_STATIC_FIFOLDER,6,22,75,8
@ -130,7 +130,7 @@ BEGIN
CONTROL "E&xtended (\\n, \\r, \\t, \\0, \\x...)",IDEXTENDED_FIFOLDER, "Button",BS_AUTORADIOBUTTON,12,155,145,10
CONTROL "Re&gular expression",IDREGEXP_FIFOLDER,"Button",BS_AUTORADIOBUTTON,12,167,78,10
CONTROL "&. matches newline",IDREDOTMATCHNL_FIFOLDER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,93,167,68,9
PUSHBUTTON "Find all",IDOK,268,20,90,14,WS_GROUP
PUSHBUTTON "Find All",IDOK,268,20,90,14,WS_GROUP
PUSHBUTTON "Close",IDCANCEL,268,38,90,14
END

View File

@ -238,7 +238,8 @@ INT_PTR CALLBACK WindowsDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPa
{
case WM_INITDIALOG :
{
changeDlgLang();
NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance())->getNativeLangSpeaker();
pNativeSpeaker->changeDlgLang(_hSelf, "Window");
return MyBaseClass::run_dlgProc(message, wParam, lParam);
}
@ -461,56 +462,11 @@ void WindowsDlg::updateButtonState()
EnableWindow(GetDlgItem(_hSelf, IDC_WINDOWS_SORT), TRUE);
}
int WindowsDlg::doDialog(TiXmlNodeA *dlgNode)
int WindowsDlg::doDialog()
{
_dlgNode = dlgNode;
return static_cast<int>(DialogBoxParam(_hInst, MAKEINTRESOURCE(IDD_WINDOWS), _hParent, dlgProc, reinterpret_cast<LPARAM>(this)));
};
bool WindowsDlg::changeDlgLang()
{
if (!_dlgNode) return false;
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
int nativeLangEncoding = CP_ACP;
TiXmlDeclarationA *declaration = _dlgNode->GetDocument()->FirstChild()->ToDeclaration();
if (declaration)
{
const char * encodingStr = declaration->Encoding();
EncodingMapper *em = EncodingMapper::getInstance();
nativeLangEncoding = em->getEncodingFromString(encodingStr);
}
// Set Title
const char *titre = (_dlgNode->ToElement())->Attribute("title");
if (titre && titre[0])
{
const wchar_t *nameW = wmc->char2wchar(titre, nativeLangEncoding);
::SetWindowText(_hSelf, nameW);
}
// Set the text of child control
for (TiXmlNodeA *childNode = _dlgNode->FirstChildElement("Item");
childNode ;
childNode = childNode->NextSibling("Item") )
{
TiXmlElementA *element = childNode->ToElement();
int id;
const char *sentinel = element->Attribute("id", &id);
const char *name = element->Attribute("name");
if (sentinel && (name && name[0]))
{
HWND hItem = ::GetDlgItem(_hSelf, id);
if (hItem)
{
const wchar_t *nameW = wmc->char2wchar(name, nativeLangEncoding);
::SetWindowText(hItem, nameW);
}
}
}
return true;
}
BOOL WindowsDlg::onInitDialog()
{
_winMgr.InitToFitSizeFromCurrent(_hSelf);

View File

@ -32,7 +32,6 @@
#include "Common.h"
class DocTabView;
class TiXmlNodeA;
typedef enum {
WDT_ACTIVATE = 1,
@ -69,11 +68,10 @@ class WindowsDlg : public SizeableDlg
public :
WindowsDlg();
int doDialog(TiXmlNodeA *dlgNode);
int doDialog();
virtual void init(HINSTANCE hInst, HWND parent, DocTabView *pTab);
void doRefresh(bool invalidate = false);
bool changeDlgLang();
protected :
virtual INT_PTR CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
@ -101,7 +99,6 @@ protected :
int _currentColumn = -1;
int _lastSort = -1;
bool _reverseSort = false;
TiXmlNodeA *_dlgNode = nullptr;
private:
virtual void init(HINSTANCE hInst, HWND parent);