Make "total documents number" feature in Window dialog translatable

This commit is contained in:
Don HO 2020-12-16 18:49:06 +01:00
parent 435834651b
commit 0546f75a71
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
6 changed files with 12 additions and 11 deletions

View File

@ -1214,6 +1214,7 @@ Continue?"/>
<ColumnPath name="Path"/>
<ColumnType name="Type"/>
<ColumnSize name="Size"/>
<NbDocsTotal name="total documents:"/>
</WindowsDlg>
<AsciiInsertion>
<PanelTitle name="ASCII Codes Insertion Panel"/>

View File

@ -1170,6 +1170,7 @@ Voulez-vous les poursuivez ?"/>
<ColumnPath name="Chemin"/>
<ColumnType name="Type"/>
<ColumnSize name="Taille"/>
<NbDocsTotal name="nombre de documents :"/>
</WindowsDlg>
<AsciiInsertion>
<PanelTitle name="Panneau des codes ASCII"/>

View File

@ -1160,6 +1160,7 @@
<ColumnPath name="路徑"/>
<ColumnType name="類型"/>
<ColumnSize name="長度"/>
<NbDocsTotal name="文件數:"/>
</WindowsDlg>
<AsciiInsertion>
<PanelTitle name="ASCII 插入面板"/>

View File

@ -49,7 +49,7 @@ using namespace std;
#define WD_CLMNPATH "ColumnPath"
#define WD_CLMNTYPE "ColumnType"
#define WD_CLMNSIZE "ColumnSize"
#define WD_TABTOTAL "TabsTotal"
#define WD_NBDOCSTOTAL "NbDocsTotal"
static const TCHAR *readonlyString = TEXT(" [Read Only]");
const UINT WDN_NOTIFY = RegisterWindowMessage(TEXT("WDN_NOTIFY"));
@ -875,13 +875,11 @@ void WindowsDlg::doClose()
void WindowsDlg::doCount()
{
NativeLangSpeaker* pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker();
TCHAR count[32];
wsprintf(count, TEXT("%d"), _idxMap.size());
generic_string msg = TEXT("Windows -- ");
msg += pNativeSpeaker->getAttrNameStr(TEXT("Total documents opened: "), WD_ROOTNODE, WD_TABTOTAL);
msg += count;
generic_string msg = pNativeSpeaker->getAttrNameStr(TEXT("Windows"), "Dialog", "Window", "title");
msg += TEXT(" - ");
msg += pNativeSpeaker->getAttrNameStr(TEXT("Total documents: "), WD_ROOTNODE, WD_NBDOCSTOTAL);
msg += to_wstring(_idxMap.size());
SetWindowText(_hSelf,msg.c_str());
}

View File

@ -1330,7 +1330,7 @@ generic_string NativeLangSpeaker::getProjectPanelLangMenuStr(const char * nodeNa
return defaultStr;
}
generic_string NativeLangSpeaker::getAttrNameStr(const TCHAR *defaultStr, const char *nodeL1Name, const char *nodeL2Name) const
generic_string NativeLangSpeaker::getAttrNameStr(const TCHAR *defaultStr, const char *nodeL1Name, const char *nodeL2Name, const char *nodeL3Name) const
{
if (!_nativeLangA) return defaultStr;
@ -1341,7 +1341,7 @@ generic_string NativeLangSpeaker::getAttrNameStr(const TCHAR *defaultStr, const
if (!targetNode) return defaultStr;
const char *name = (targetNode->ToElement())->Attribute("name");
const char *name = (targetNode->ToElement())->Attribute(nodeL3Name);
if (name && name[0])
{
WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance();

View File

@ -90,7 +90,7 @@ public:
generic_string getShortcutMapperLangStr(const char *nodeName, const TCHAR *defaultStr) const;
generic_string getProjectPanelLangMenuStr(const char * nodeName, int cmdID, const TCHAR *defaultStr) const;
generic_string getFileBrowserLangMenuStr(int cmdID, const TCHAR *defaultStr) const;
generic_string getAttrNameStr(const TCHAR *defaultStr, const char *nodeL1Name, const char *nodeL2Name = NULL) const;
generic_string getAttrNameStr(const TCHAR *defaultStr, const char *nodeL1Name, const char *nodeL2Name, const char *nodeL3Name = "name") const;
generic_string getLocalizedStrFromID(const char *strID, const generic_string& defaultString) const;
int messageBox(const char *msgBoxTagName, HWND hWnd, const TCHAR *message, const TCHAR *title, int msgBoxType, int intInfo = 0, const TCHAR *strInfo = NULL);