Add capabilty to translate file summary dialog info

Close #5594, fix #1487
This commit is contained in:
Christian Grasser 2019-04-27 12:48:30 +02:00 committed by Don HO
parent 4a80a125c0
commit 418d03acfe
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E
3 changed files with 87 additions and 55 deletions

View File

@ -1234,6 +1234,18 @@ Continue?"/>
<userdefined-title-rename value="Rename Current Language Name"/> <userdefined-title-rename value="Rename Current Language Name"/>
<autocomplete-nb-char value="Nb char: "/> <autocomplete-nb-char value="Nb char: "/>
<edit-verticaledge-nb-col value="Nb of Column:"/> <edit-verticaledge-nb-col value="Nb of Column:"/>
<summary value="Summary"/>
<summary-filepath value="Full file path: "/>
<summary-filecreatetime value="Created: "/>
<summary-filemodifytime value="Modified: "/>
<summary-filelen value="File length (in byte): "/>
<summary-nbchar value="Characters (without line endings): "/>
<summary-nbword value="Words: "/>
<summary-nbline value="Lines: "/>
<summary-nbbyte value="Current document length: "/>
<summary-nbsel1 value=" selected characters ("/>
<summary-nbsel2 value=" bytes) in "/>
<summary-nbrange value=" ranges"/>
</MiscStrings> </MiscStrings>
</Native-Langue> </Native-Langue>
</NotepadPlus> </NotepadPlus>

View File

@ -1196,6 +1196,18 @@
<userdefined-title-rename value="Akt. Sprache umbenennen"/> <userdefined-title-rename value="Akt. Sprache umbenennen"/>
<autocomplete-nb-char value="Anz. Zeichen: "/> <autocomplete-nb-char value="Anz. Zeichen: "/>
<edit-verticaledge-nb-col value="Anz. Spalten: "/> <edit-verticaledge-nb-col value="Anz. Spalten: "/>
<summary value="Dateiinfo"/>
<summary-filepath value="Kompletter Pfad: "/>
<summary-filecreatetime value="Erzeugt: "/>
<summary-filemodifytime value="Geändert: "/>
<summary-filelen value="Dateigrösse (in Byte): "/>
<summary-nbchar value="Zeichen (ohne Zeilenenden): "/>
<summary-nbword value="Wörter: "/>
<summary-nbline value="Zeilen: "/>
<summary-nbbyte value="Aktuelle Dateigrösse: "/>
<summary-nbsel1 value=" markierte Zeichen ("/>
<summary-nbsel2 value=" Bytes) in "/>
<summary-nbrange value=" Abschnitten"/>
</MiscStrings> </MiscStrings>
</Native-Langue> </Native-Langue>
</NotepadPlus> </NotepadPlus>

View File

@ -2018,12 +2018,17 @@ void Notepad_plus::command(int id)
Buffer * curBuf = _pEditView->getCurrentBuffer(); Buffer * curBuf = _pEditView->getCurrentBuffer();
int64_t fileLen = curBuf->getFileLength(); int64_t fileLen = curBuf->getFileLength();
// localization for summary date
NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance())->getNativeLangSpeaker();
if (pNativeSpeaker)
{
if (fileLen != -1) if (fileLen != -1)
{ {
const TCHAR *filePathLabel = TEXT("Full file path: "); generic_string filePathLabel = pNativeSpeaker->getLocalizedStrFromID("summary-filepath", TEXT("Full file path: "));
const TCHAR *fileCreateTimeLabel = TEXT("Created: "); generic_string fileCreateTimeLabel = pNativeSpeaker->getLocalizedStrFromID("summary-filecreatetime", TEXT("Created: "));
const TCHAR *fileModifyTimeLabel = TEXT("Modified: "); generic_string fileModifyTimeLabel = pNativeSpeaker->getLocalizedStrFromID("summary-filemodifytime", TEXT("Modified: "));
const TCHAR *fileLenLabel = TEXT("File length (in byte): "); generic_string fileLenLabel = pNativeSpeaker->getLocalizedStrFromID("summary-filelen", TEXT("File length (in byte): "));
characterNumber += filePathLabel; characterNumber += filePathLabel;
characterNumber += curBuf->getFullPathName(); characterNumber += curBuf->getFullPathName();
@ -2042,13 +2047,13 @@ void Notepad_plus::command(int id)
characterNumber += TEXT("\r"); characterNumber += TEXT("\r");
characterNumber += TEXT("\r"); characterNumber += TEXT("\r");
} }
const TCHAR *nbCharLabel = TEXT("Characters (without line endings): "); generic_string nbCharLabel = pNativeSpeaker->getLocalizedStrFromID("summary-nbchar", TEXT("Characters (without line endings): "));
const TCHAR *nbWordLabel = TEXT("Words: "); generic_string nbWordLabel = pNativeSpeaker->getLocalizedStrFromID("summary-nbword", TEXT("Words: "));
const TCHAR *nbLineLabel = TEXT("Lines: "); generic_string nbLineLabel = pNativeSpeaker->getLocalizedStrFromID("summary-nbline", TEXT("Lines: "));
const TCHAR *nbByteLabel = TEXT("Current document length: "); generic_string nbByteLabel = pNativeSpeaker->getLocalizedStrFromID("summary-nbbyte", TEXT("Current document length: "));
const TCHAR *nbSelLabel1 = TEXT(" selected characters ("); generic_string nbSelLabel1 = pNativeSpeaker->getLocalizedStrFromID("summary-nbsel1", TEXT(" selected characters ("));
const TCHAR *nbSelLabel2 = TEXT(" bytes) in "); generic_string nbSelLabel2 = pNativeSpeaker->getLocalizedStrFromID("summary-nbsel2", TEXT(" bytes) in "));
const TCHAR *nbRangeLabel = TEXT(" ranges"); generic_string nbRangeLabel = pNativeSpeaker->getLocalizedStrFromID("summary-nbrange", TEXT(" ranges"));
UniMode um = _pEditView->getCurrentBuffer()->getUnicodeMode(); UniMode um = _pEditView->getCurrentBuffer()->getUnicodeMode();
auto nbChar = getCurrentDocCharCount(um); auto nbChar = getCurrentDocCharCount(um);
@ -2083,7 +2088,10 @@ void Notepad_plus::command(int id)
characterNumber += nbRangeLabel; characterNumber += nbRangeLabel;
characterNumber += TEXT("\r"); characterNumber += TEXT("\r");
::MessageBox(_pPublicInterface->getHSelf(), characterNumber.c_str(), TEXT("Summary"), MB_OK|MB_APPLMODAL); generic_string summaryLabel = pNativeSpeaker->getLocalizedStrFromID("summary", TEXT("Summary"));
::MessageBox(_pPublicInterface->getHSelf(), characterNumber.c_str(), summaryLabel.c_str(), MB_OK|MB_APPLMODAL);
}
} }
break; break;