Make more dialog strings translatable

This commit is contained in:
Don HO 2018-02-04 21:38:49 +01:00
parent 1f7f00b607
commit 1a86603a0c
12 changed files with 373 additions and 281 deletions

View File

@ -905,7 +905,7 @@
<Item id="2" name="Cancel"/>
</ColumnEditor>
</Dialog>
<MessageBox>
<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.
You have to restart your Notepad++ to take effect after modifying contextMenu.xml."/>
<NppHelpAbsentWarning title="File does not exist" message="
@ -924,7 +924,6 @@ Continue?"/>
<FileAlreadyOpenedInNpp title="" message="The file is already opened in the Notepad++."/>
<DeleteFileFailed title="Delete File" message="Delete File failed"/>
<!-- $INT_REPLACE$ is a place holder, don't translate it -->
<NbFileToOpenImportantWarning title="Amount of files to open is too large" message="$INT_REPLACE$ files are about to be opened.
Are you sure to open them?"/>
<SettingsOnCloudError title="Settings on Cloud" message="It seems the path of settings on cloud is set on a read only drive,
@ -932,14 +931,44 @@ or on a folder needed privilege right for writing access.
Your settings on cloud will be canceled. Please reset a coherent value via Preference dialog."/>
<FilePathNotFoundWarning title="File Open" message="The file you're trying to open doesn't exist."/>
<SessionFileInvalidError title="Could not Load Session" message="Session file is either corrupted or not valid."/>
<DroppingFolderAsProjetModeWarning title="Invalid action" message="You can drop only files or folders but not both, because you're in dropping Folder as Projet mode.
you have to enable &quot;Open all files of folder instead of launching Folder as Workspace on folder dropping&quot; in &quot;Default Directory&quot; section of Preferences dialog to make this operation work."/>
<SortingError title="Sorting Error" message="Unable to perform numeric sort due to line $STR_REPLACE$."/>
<ColumnModeTip title="Column Mode Tip" message="Please use &quot;ALT+Mouse Selection&quot; or &quot;Alt+Shift+Arrow key&quot; to switch to column mode."/>
<BufferInvalidWarning title="Save failed" message="Cannot save: Buffer is invalid."/>
<DoSaveOrNot title="Save" message="Save file &quot;$STR_REPLACE$&quot; ?"/>
<DoCloseOrNot title="Keep non existing file" message="The file &quot;$STR_REPLACE$&quot; doesn't exist anymore.
Keep this file in editor?"/>
<DoDeleteOrNot title="Delete file" message="The file &quot;$STR_REPLACE$&quot;
will be moved to your Recycle Bin and this document will be closed.
Continue?"/>
<NoBackupDoSaveFile title="Save" message="Your backup file cannot be found (deleted from outside).
Save it otherwise your data will be lost
Do you want to save file &quot;$STR_REPLACE$&quot; ?"/>
<DoReloadOrNot title="Reload" message="&quot;$STR_REPLACE$&quot;
This file has been modified by another program.
Do you want to reload it?"/>
<DoReloadOrNotAndLooseChange title="Reload" message="&quot;$STR_REPLACE$&quot;
This file has been modified by another program.
Do you want to reload it and lose the changes made in Notepad++?"/>
<PrehistoricSystemDetected title="Prehistoric system detected" message="It seems you still use a prehistoric system, This feature works only on a modern system, sorry."/>
<XpUpdaterProblem title="Notepad++ Updater" message="Notepad++ updater is not compatible with XP due to the obsolete security layer under XP.
Do you want to go to Notepad++ page to download the latest version?"/>
<DocTooDirtyToMonitor title="Monitoring problem" message="The document is dirty. Please save the modification before monitoring it."/>
<DocNoExistToMonitor title="Monitoring problem" message="The file should exist to be monitored."/>
<FileTooBigToOpene title="File size problem" message="File is too big to be opened by Notepad++"/>
<CreateNewFileOrNot title="Create new file" message="&quot;$INT_REPLACE$&quot; doesn't exist. Create it?."/>
<CreateNewFileError title="Create new file" message="Cannot create the file &quot;$INT_REPLACE$&quot;."/>
<OpenFileError title="ERROR" message="Can not open file &quot;$INT_REPLACE$&quot;."/>
<FileBackupFailed title="File Backup Failed" message="The previous version of the file could not be saved into the backup directory at &quot;$INT_REPLACE$&quot;.
Do you want to save the current file anyways?"/>
<LoadStylersFailed title="Load stylers.xml failed" message="Load &quot;$INT_REPLACE$&quot; failed!"/>
<LoadLangsFailed title="Configurator" message="Load langs.xml failed!
Do you want to recover your langs.xml?"/>
<LoadLangsFailedFinal title="Configurator" message="Load langs.xml failed!"/>
</MessageBox>
<ClipboardHistory>
<PanelTitle name="Clipboard History"/>
@ -1020,7 +1049,7 @@ you have to enable &quot;Open all files of folder instead of launching Folder as
<cloud-invalid-warning value="Invalid path."/>
<cloud-restart-warning value="Please restart Notepad++ to take effect."/>
<shift-change-direction-tip value="Use Shift + Enter to search in the opposite direction"/>
<1-to-2-buttons-tip value="2 find buttons mode"/>
<two-find-buttons-tip value="2 find buttons mode"/>
</MiscStrings>
</Native-Langue>
</NotepadPlus>

View File

@ -905,7 +905,7 @@
<Item id="2" name="Cancel"/>
</ColumnEditor>
</Dialog>
<MessageBox>
<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.
You have to restart your Notepad++ to take effect after modifying contextMenu.xml."/>
<NppHelpAbsentWarning title="File does not exist" message="
@ -924,7 +924,6 @@ Continue?"/>
<FileAlreadyOpenedInNpp title="" message="The file is already opened in the Notepad++."/>
<DeleteFileFailed title="Delete File" message="Delete File failed"/>
<!-- $INT_REPLACE$ is a place holder, don't translate it -->
<NbFileToOpenImportantWarning title="Amount of files to open is too large" message="$INT_REPLACE$ files are about to be opened.
Are you sure to open them?"/>
<SettingsOnCloudError title="Settings on Cloud" message="It seems the path of settings on cloud is set on a read only drive,
@ -932,6 +931,44 @@ or on a folder needed privilege right for writing access.
Your settings on cloud will be canceled. Please reset a coherent value via Preference dialog."/>
<FilePathNotFoundWarning title="File Open" message="The file you're trying to open doesn't exist."/>
<SessionFileInvalidError title="Could not Load Session" message="Session file is either corrupted or not valid."/>
<DroppingFolderAsProjetModeWarning title="Invalid action" message="You can drop only files or folders but not both, because you're in dropping Folder as Projet mode.
you have to enable &quot;Open all files of folder instead of launching Folder as Workspace on folder dropping&quot; in &quot;Default Directory&quot; section of Preferences dialog to make this operation work."/>
<SortingError title="Sorting Error" message="Unable to perform numeric sort due to line $STR_REPLACE$."/>
<ColumnModeTip title="Column Mode Tip" message="Please use &quot;ALT+Mouse Selection&quot; or &quot;Alt+Shift+Arrow key&quot; to switch to column mode."/>
<BufferInvalidWarning title="Save failed" message="Cannot save: Buffer is invalid."/>
<DoSaveOrNot title="Save" message="Save file &quot;$STR_REPLACE$&quot; ?"/>
<DoCloseOrNot title="Keep non existing file" message="The file &quot;$STR_REPLACE$&quot; doesn't exist anymore.
Keep this file in editor?"/>
<DoDeleteOrNot title="Delete file" message="The file &quot;$STR_REPLACE$&quot;
will be moved to your Recycle Bin and this document will be closed.
Continue?"/>
<NoBackupDoSaveFile title="Save" message="Your backup file cannot be found (deleted from outside).
Save it otherwise your data will be lost
Do you want to save file &quot;$STR_REPLACE$&quot; ?"/>
<DoReloadOrNot title="Reload" message="&quot;$STR_REPLACE$&quot;
This file has been modified by another program.
Do you want to reload it?"/>
<DoReloadOrNotAndLooseChange title="Reload" message="&quot;$STR_REPLACE$&quot;
This file has been modified by another program.
Do you want to reload it and lose the changes made in Notepad++?"/>
<PrehistoricSystemDetected title="Prehistoric system detected" message="It seems you still use a prehistoric system, This feature works only on a modern system, sorry."/>
<XpUpdaterProblem title="Notepad++ Updater" message="Notepad++ updater is not compatible with XP due to the obsolete security layer under XP.
Do you want to go to Notepad++ page to download the latest version?"/>
<DocTooDirtyToMonitor title="Monitoring problem" message="The document is dirty. Please save the modification before monitoring it."/>
<DocNoExistToMonitor title="Monitoring problem" message="The file should exist to be monitored."/>
<FileTooBigToOpene title="File size problem" message="File is too big to be opened by Notepad++"/>
<CreateNewFileOrNot title="Create new file" message="&quot;$INT_REPLACE$&quot; doesn't exist. Create it?."/>
<CreateNewFileError title="Create new file" message="Cannot create the file &quot;$INT_REPLACE$&quot;."/>
<OpenFileError title="ERROR" message="Can not open file &quot;$INT_REPLACE$&quot;."/>
<FileBackupFailed title="File Backup Failed" message="The previous version of the file could not be saved into the backup directory at &quot;$INT_REPLACE$&quot;.
Do you want to save the current file anyways?"/>
<LoadStylersFailed title="Load stylers.xml failed" message="Load &quot;$INT_REPLACE$&quot; failed!"/>
<LoadLangsFailed title="Configurator" message="Load langs.xml failed!
Do you want to recover your langs.xml?"/>
<LoadLangsFailedFinal title="Configurator" message="Load langs.xml failed!"/>
</MessageBox>
<ClipboardHistory>
<PanelTitle name="Clipboard History"/>
@ -1012,7 +1049,7 @@ Your settings on cloud will be canceled. Please reset a coherent value via Prefe
<cloud-invalid-warning value="Invalid path."/>
<cloud-restart-warning value="Please restart Notepad++ to take effect."/>
<shift-change-direction-tip value="Use Shift + Enter to search in the opposite direction"/>
<1-to-2-buttons-tip value="2 find buttons mode"/>
<two-find-buttons-tip value="2 find buttons mode"/>
</MiscStrings>
</Native-Langue>
</NotepadPlus>

View File

@ -1824,41 +1824,55 @@ void Notepad_plus::filePrint(bool showDialog)
int Notepad_plus::doSaveOrNot(const TCHAR *fn)
{
TCHAR pattern[64] = TEXT("Save file \"%s\" ?");
TCHAR phrase[512];
wsprintf(phrase, pattern, fn);
return doActionOrNot(TEXT("Save"), phrase, MB_YESNOCANCEL | MB_ICONQUESTION | MB_APPLMODAL);
return _nativeLangSpeaker.messageBox("DoSaveOrNot",
_pPublicInterface->getHSelf(),
TEXT("Save file \"$STR_REPLACE$\" ?"),
TEXT("Save"),
MB_YESNOCANCEL | MB_ICONQUESTION | MB_APPLMODAL,
0, // not used
fn);
}
int Notepad_plus::doReloadOrNot(const TCHAR *fn, bool dirty)
{
TCHAR* pattern = TEXT("%s\r\rThis file has been modified by another program.\rDo you want to reload it%s?");
TCHAR* lose_info_str = dirty ? TEXT(" and lose the changes made in Notepad++") : TEXT("");
TCHAR phrase[512];
wsprintf(phrase, pattern, fn, lose_info_str);
int icon = dirty ? MB_ICONEXCLAMATION : MB_ICONQUESTION;
return doActionOrNot(TEXT("Reload"), phrase, MB_YESNO | MB_APPLMODAL | icon);
if (dirty)
return _nativeLangSpeaker.messageBox("DoReloadOrNotAndLooseChange",
_pPublicInterface->getHSelf(),
TEXT("\"$STR_REPLACE$\"\r\rThis file has been modified by another program.\rDo you want to reload it and lose the changes made in Notepad++?"),
TEXT("Reload"),
MB_YESNO | MB_APPLMODAL | MB_ICONEXCLAMATION,
0, // not used
fn);
else
return _nativeLangSpeaker.messageBox("DoReloadOrNot",
_pPublicInterface->getHSelf(),
TEXT("\"$STR_REPLACE$\"\r\rThis file has been modified by another program.\rDo you want to reload it?"),
TEXT("Reload"),
MB_YESNO | MB_APPLMODAL | MB_ICONQUESTION,
0, // not used
fn);
}
int Notepad_plus::doCloseOrNot(const TCHAR *fn)
{
TCHAR pattern[128] = TEXT("The file \"%s\" doesn't exist anymore.\rKeep this file in editor?");
TCHAR phrase[512];
wsprintf(phrase, pattern, fn);
return doActionOrNot(TEXT("Keep non existing file"), phrase, MB_YESNO | MB_ICONQUESTION | MB_APPLMODAL);
return _nativeLangSpeaker.messageBox("DoCloseOrNot",
_pPublicInterface->getHSelf(),
TEXT("The file \"$STR_REPLACE$\" doesn't exist anymore.\rKeep this file in editor?"),
TEXT("Keep non existing file"),
MB_YESNO | MB_ICONQUESTION | MB_APPLMODAL,
0, // not used
fn);
}
int Notepad_plus::doDeleteOrNot(const TCHAR *fn)
{
TCHAR pattern[128] = TEXT("The file \"%s\"\rwill be moved to your Recycle Bin and this document will be closed.\rContinue?");
TCHAR phrase[512];
wsprintf(phrase, pattern, fn);
return doActionOrNot(TEXT("Delete file"), phrase, MB_YESNO | MB_ICONQUESTION | MB_APPLMODAL);
}
int Notepad_plus::doActionOrNot(const TCHAR *title, const TCHAR *displayText, int type)
{
return ::MessageBox(_pPublicInterface->getHSelf(), displayText, title, type);
return _nativeLangSpeaker.messageBox("DoDeleteOrNot",
_pPublicInterface->getHSelf(),
TEXT("The file \"$STR_REPLACE$\"\rwill be moved to your Recycle Bin and this document will be closed.\rContinue?"),
TEXT("Delete file"),
MB_YESNO | MB_ICONQUESTION | MB_APPLMODAL,
0, // not used
fn);
}
void Notepad_plus::enableMenu(int cmdID, bool doEnable) const
@ -5873,7 +5887,12 @@ void Notepad_plus::launchDocMap()
{
if (!(NppParameters::getInstance())->isTransparentAvailable())
{
::MessageBox(NULL, TEXT("It seems you still use a prehistoric system, This feature works only on a modern system, sorry."), TEXT(""), MB_OK);
_nativeLangSpeaker.messageBox("PrehistoricSystemDetected",
_pPublicInterface->getHSelf(),
TEXT("It seems you still use a prehistoric system, This feature works only on a modern system, sorry."),
TEXT("Prehistoric system detected"),
MB_OK);
return;
}
@ -5961,10 +5980,6 @@ void Notepad_plus::launchFunctionList()
}
struct TextPlayerParams
{
HWND _nppHandle;
@ -5988,8 +6003,6 @@ struct Quote
const char *_quote;
};
const int nbQuote = 203;
Quote quotes[nbQuote] =
{

View File

@ -693,6 +693,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
{
if (lstrlen(fileStr) >= int(wParam))
{
// Not message for users so no translation
::MessageBox(hwnd, TEXT("Allocated buffer size is not enough to copy the string."), TEXT("NPPM error"), MB_OK);
return FALSE;
}
@ -714,6 +715,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
{
if (lstrlen(str) >= int(wParam)) //buffer too small
{
// Not message for users so no translation
::MessageBox(hwnd, TEXT("Allocated buffer size is not enough to copy the string."), TEXT("NPPM_GETCURRENTWORD error"), MB_OK);
return FALSE;
}
@ -770,6 +772,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
if (lstrlen(str) >= int(wParam)) //buffer too small
{
// Not message for users so no translation
::MessageBox(hwnd, TEXT("Allocated buffer size is not enough to copy the string."), TEXT("NPPM_GETFILENAMEATCURSOR error"), MB_OK);
return FALSE;
}
@ -797,6 +800,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
{
if (lstrlen(str) >= int(wParam))
{
// Not message for users so no translation
::MessageBox(hwnd, TEXT("Allocated buffer size is not enough to copy the string."), TEXT("NPPM_GETNPPDIRECTORY error"), MB_OK);
return FALSE;
}

View File

@ -1984,7 +1984,11 @@ void Notepad_plus::command(int id)
{
if (curBuf->isDirty())
{
::MessageBox(_pPublicInterface->getHSelf(), TEXT("The document is dirty. Please save the modification before monitoring it."), TEXT("Monitoring problem"), MB_OK);
_nativeLangSpeaker.messageBox("DocTooDirtyToMonitor",
_pPublicInterface->getHSelf(),
TEXT("The document is dirty. Please save the modification before monitoring it."),
TEXT("Monitoring problem"),
MB_OK);
}
else
{
@ -2000,7 +2004,11 @@ void Notepad_plus::command(int id)
}
else
{
::MessageBox(_pPublicInterface->getHSelf(), TEXT("The file should exist to be monitored."), TEXT("Monitoring problem"), MB_OK);
_nativeLangSpeaker.messageBox("DocNoExistToMonitor",
_pPublicInterface->getHSelf(),
TEXT("The file should exist to be monitored."),
TEXT("Monitoring problem"),
MB_OK);
}
}
@ -2076,7 +2084,7 @@ void Notepad_plus::command(int id)
if (buf->isDirty())
{
int answer = _nativeLangSpeaker.messageBox("SaveCurrentModifWarning",
NULL,
_pPublicInterface->getHSelf(),
TEXT("You should save the current modification.\rAll the saved modifications can not be undone.\r\rContinue?"),
TEXT("Save Current Modification"),
MB_YESNO);
@ -2094,7 +2102,7 @@ void Notepad_plus::command(int id)
{
generic_string msg, title;
int answer = _nativeLangSpeaker.messageBox("LoseUndoAbilityWarning",
NULL,
_pPublicInterface->getHSelf(),
TEXT("You should save the current modification.\rAll the saved modifications can not be undone.\r\rContinue?"),
TEXT("Lose Undo Ability Waning"),
MB_YESNO);
@ -2191,7 +2199,7 @@ void Notepad_plus::command(int id)
{
generic_string warning, title;
int answer = _nativeLangSpeaker.messageBox("SaveCurrentModifWarning",
NULL,
_pPublicInterface->getHSelf(),
TEXT("You should save the current modification.\rAll the saved modifications can not be undone.\r\rContinue?"),
TEXT("Save Current Modification"),
MB_YESNO);
@ -2209,7 +2217,7 @@ void Notepad_plus::command(int id)
{
generic_string msg, title;
int answer = _nativeLangSpeaker.messageBox("LoseUndoAbilityWarning",
NULL,
_pPublicInterface->getHSelf(),
TEXT("You should save the current modification.\rAll the saved modifications can not be undone.\r\rContinue?"),
TEXT("Lose Undo Ability Waning"),
MB_YESNO);
@ -2665,6 +2673,7 @@ void Notepad_plus::command(int id)
case IDM_CMDLINEARGUMENTS:
{
// No translattable
::MessageBox(NULL, COMMAND_ARG_HELP, TEXT("Notepad++ Command Argument Help"), MB_OK);
break;
}
@ -2694,7 +2703,12 @@ void Notepad_plus::command(int id)
winVer ver = NppParameters::getInstance()->getWinVersion();
if (ver <= WV_XP)
{
long res = ::MessageBox(NULL, TEXT("Notepad++ updater is not compatible with XP due to the obsolete security layer under XP.\rDo you want to go to Notepad++ page to download the latest version?"), TEXT("Notepad++ Updater"), MB_YESNO);
long res = _nativeLangSpeaker.messageBox("XpUpdaterProblem",
_pPublicInterface->getHSelf(),
TEXT("Notepad++ updater is not compatible with XP due to the obsolete security layer under XP.\rDo you want to go to Notepad++ page to download the latest version?"),
TEXT("Notepad++ Updater"),
MB_YESNO);
if (res == IDYES)
{
::ShellExecute(NULL, TEXT("open"), TEXT("https://notepad-plus-plus.org/download/"), NULL, NULL, SW_SHOWNORMAL);

View File

@ -50,14 +50,10 @@ DWORD WINAPI Notepad_plus::monitorFileOnChange(void * params)
//The folder to watch :
WCHAR folderToMonitor[MAX_PATH];
//::MessageBoxW(NULL, mfp->_fullFilePath, TEXT("PATH AFTER thread"), MB_OK);
lstrcpy(folderToMonitor, fullFileName);
//MessageBox(NULL, fullFileName, TEXT("fullFileName"), MB_OK);
::PathRemoveFileSpecW(folderToMonitor);
//MessageBox(NULL, folderToMonitor, TEXT("folderToMonitor"), MB_OK);
const DWORD dwNotificationFlags = FILE_NOTIFY_CHANGE_LAST_WRITE | FILE_NOTIFY_CHANGE_FILE_NAME;
// Create the monitor and add directory to watch.
@ -121,7 +117,6 @@ DWORD WINAPI Notepad_plus::monitorFileOnChange(void * params)
// Just for sample purposes. The destructor will
// call Terminate() automatically.
changes.Terminate();
//MessageBox(NULL, TEXT("FREEDOM !!!"), TEXT("out"), MB_OK);
delete monitorInfo;
return EXIT_SUCCESS;
}
@ -181,8 +176,6 @@ BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive,
BufferID test = MainFileManager->getBufferFromName(fileName2Find.c_str());
if (test != BUFFER_INVALID && !isSnapshotMode)
{
//switchToFile(test);
//Dont switch, not responsibility of doOpen, but of caller
if (_pTrayIco)
{
if (_pTrayIco->isInTray())
@ -229,8 +222,15 @@ BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive,
bool isCreateFileSuccessful = false;
if (PathFileExists(longFileDir.c_str()))
{
wsprintf(str2display, TEXT("%s doesn't exist. Create it?"), longFileName);
if (::MessageBox(_pPublicInterface->getHSelf(), str2display, TEXT("Create new file"), MB_YESNO) == IDYES)
int res = _nativeLangSpeaker.messageBox("CreateNewFileOrNot",
_pPublicInterface->getHSelf(),
TEXT("\"$INT_REPLACE$\" doesn't exist. Create it?."),
TEXT("Create new file"),
MB_YESNO,
0,
longFileName);
if (res == IDYES)
{
bool res = MainFileManager->createEmptyFile(longFileName);
if (res)
@ -239,8 +239,13 @@ BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive,
}
else
{
wsprintf(str2display, TEXT("Cannot create the file \"%s\""), longFileName);
::MessageBox(_pPublicInterface->getHSelf(), str2display, TEXT("Create new file"), MB_OK);
_nativeLangSpeaker.messageBox("CreateNewFileError",
_pPublicInterface->getHSelf(),
TEXT("Cannot create the file \"$INT_REPLACE$\"."),
TEXT("Create new file"),
MB_OK,
0,
longFileName);
}
}
}
@ -389,10 +394,14 @@ BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive,
}
else
{
generic_string msg = TEXT("Can not open file \"");
msg += longFileName;
msg += TEXT("\".");
::MessageBox(_pPublicInterface->getHSelf(), msg.c_str(), TEXT("ERROR"), MB_OK);
_nativeLangSpeaker.messageBox("OpenFileError",
_pPublicInterface->getHSelf(),
TEXT("Can not open file \"$INT_REPLACE$\"."),
TEXT("ERROR"),
MB_OK,
0,
longFileName);
_isFileOpening = false;
scnN.nmhdr.code = NPPN_FILELOADFAILED;
@ -900,10 +909,14 @@ bool Notepad_plus::fileCloseAll(bool doDeleteBackup, bool isSnapshotMode)
if(!activateBuffer(id, SUB_VIEW))
switchEditViewTo(MAIN_VIEW);
TCHAR pattern[140] = TEXT("Your backup file cannot be found (deleted from outside).\rSave it otherwise your data will be lost\rDo you want to save file \"%s\" ?");
TCHAR phrase[512];
wsprintf(phrase, pattern, buf->getFullPathName());
int res = doActionOrNot(TEXT("Save"), phrase, MB_YESNOCANCEL | MB_ICONQUESTION | MB_APPLMODAL);
int res = _nativeLangSpeaker.messageBox("NoBackupDoSaveFile",
_pPublicInterface->getHSelf(),
TEXT("Your backup file cannot be found (deleted from outside).\rSave it otherwise your data will be lost\rDo you want to save file \"$STR_REPLACE$\" ?"),
TEXT("Save"),
MB_YESNOCANCEL | MB_ICONQUESTION | MB_APPLMODAL,
0, // not used
buf->getFullPathName());
//int res = doSaveOrNot(buf->getFullPathName());
if (res == IDYES)
{
@ -953,11 +966,14 @@ bool Notepad_plus::fileCloseAll(bool doDeleteBackup, bool isSnapshotMode)
activateBuffer(id, SUB_VIEW);
switchEditViewTo(SUB_VIEW);
TCHAR pattern[140] = TEXT("Your backup file cannot be found (deleted from outside).\rSave it otherwise your data will be lost\rDo you want to save file \"%s\" ?");
TCHAR phrase[512];
wsprintf(phrase, pattern, buf->getFullPathName());
int res = doActionOrNot(TEXT("Save"), phrase, MB_YESNOCANCEL | MB_ICONQUESTION | MB_APPLMODAL);
//int res = doSaveOrNot(buf->getFullPathName());
int res = _nativeLangSpeaker.messageBox("NoBackupDoSaveFile",
_pPublicInterface->getHSelf(),
TEXT("Your backup file cannot be found (deleted from outside).\rSave it otherwise your data will be lost\rDo you want to save file \"$STR_REPLACE$\" ?"),
TEXT("Save"),
MB_YESNOCANCEL | MB_ICONQUESTION | MB_APPLMODAL,
0, // not used
buf->getFullPathName());
if (res == IDYES)
{
if (!fileSave(id))
@ -1250,11 +1266,15 @@ bool Notepad_plus::fileSave(BufferID id)
if (not ::CopyFile(fn, fn_bak.c_str(), FALSE))
{
generic_string msg = TEXT("The previous version of the file could not be saved into the backup directory at ");
msg += TEXT("\"");
msg += fn_bak;
msg += TEXT("\".\r\rDo you want to save the current file anyways?");
if (::MessageBox(_pPublicInterface->getHSelf(), msg.c_str(), TEXT("File Backup Failed"), MB_YESNO | MB_ICONERROR) == IDNO)
int res = _nativeLangSpeaker.messageBox("FileBackupFailed",
_pPublicInterface->getHSelf(),
TEXT("The previous version of the file could not be saved into the backup directory at \"$INT_REPLACE$\".\r\rDo you want to save the current file anyways?"),
TEXT("File Backup Failed"),
MB_YESNO | MB_ICONERROR,
0,
fn_bak.c_str());
if (res == IDNO)
{
return false;
}

View File

@ -509,15 +509,8 @@ static const ScintillaKeyDefinition scintKeyDefs[] =
typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
int strVal(const TCHAR *str, int base)
{
int strVal(const TCHAR *str, int base)
{
if (!str) return -1;
if (!str[0]) return 0;
@ -526,21 +519,21 @@ typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
if (*finStr != '\0')
return -1;
return result;
}
}
int decStrVal(const TCHAR *str)
{
int decStrVal(const TCHAR *str)
{
return strVal(str, 10);
}
}
int hexStrVal(const TCHAR *str)
{
int hexStrVal(const TCHAR *str)
{
return strVal(str, 16);
}
}
int getKwClassFromName(const TCHAR *str)
{
int getKwClassFromName(const TCHAR *str)
{
if (!lstrcmp(TEXT("instre1"), str)) return LANG_INDEX_INSTR;
if (!lstrcmp(TEXT("instre2"), str)) return LANG_INDEX_INSTR2;
if (!lstrcmp(TEXT("type1"), str)) return LANG_INDEX_TYPE;
@ -553,17 +546,17 @@ typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
return str[0] - '0';
return -1;
}
}
size_t getAsciiLenFromBase64Len(size_t base64StrLen)
{
size_t getAsciiLenFromBase64Len(size_t base64StrLen)
{
return (base64StrLen % 4) ? 0 : (base64StrLen - base64StrLen / 4);
}
}
int base64ToAscii(char *dest, const char *base64Str)
{
int base64ToAscii(char *dest, const char *base64Str)
{
static const int base64IndexArray[123] =
{
-1, -1, -1, -1, -1, -1, -1, -1,
@ -639,16 +632,11 @@ typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO);
return k-2;
return k;
}
}
} // anonymous namespace
void cutString(const TCHAR* str2cut, vector<generic_string>& patternVect)
{
if (str2cut == nullptr) return;
@ -891,16 +879,25 @@ NppParameters::~NppParameters()
}
bool NppParameters::reloadStylers(TCHAR *stylePath)
bool NppParameters::reloadStylers(TCHAR* stylePath)
{
if (_pXmlUserStylerDoc)
delete _pXmlUserStylerDoc;
_pXmlUserStylerDoc = new TiXmlDocument(stylePath?stylePath:_stylerPath);
const TCHAR* stylePathToLoad = stylePath != nullptr ? stylePath : _stylerPath.c_str();
_pXmlUserStylerDoc = new TiXmlDocument(stylePathToLoad);
bool loadOkay = _pXmlUserStylerDoc->LoadFile();
if (!loadOkay)
{
::MessageBox(NULL, TEXT("Load stylers.xml failed!"), stylePath, MB_OK);
_pNativeLangSpeaker->messageBox("LoadStylersFailed",
NULL,
TEXT("Load \"$INT_REPLACE$\" failed!"),
TEXT("Load stylers.xml failed"),
MB_OK,
0,
stylePathToLoad);
delete _pXmlUserStylerDoc;
_pXmlUserStylerDoc = NULL;
return false;
@ -1083,7 +1080,11 @@ bool NppParameters::load()
if (generic_stat(langs_xml_path.c_str(), &buf)==0)
if (buf.st_size == 0)
doRecover = ::MessageBox(NULL, TEXT("Load langs.xml failed!\rDo you want to recover your langs.xml?"), TEXT("Configurator"),MB_YESNO);
doRecover = _pNativeLangSpeaker->messageBox("LoadLangsFailed",
NULL,
TEXT("Load langs.xml failed!\rDo you want to recover your langs.xml?"),
TEXT("Configurator"),
MB_YESNO);
}
else
doRecover = true;
@ -1101,7 +1102,12 @@ bool NppParameters::load()
bool loadOkay = _pXmlDoc->LoadFile();
if (!loadOkay)
{
::MessageBox(NULL, TEXT("Load langs.xml failed!"), TEXT("Configurator"),MB_OK);
_pNativeLangSpeaker->messageBox("LoadLangsFailedFinal",
NULL,
TEXT("Load langs.xml failed!"),
TEXT("Configurator"),
MB_OK);
delete _pXmlDoc;
_pXmlDoc = nullptr;
isAllLaoded = false;
@ -1157,7 +1163,14 @@ bool NppParameters::load()
loadOkay = _pXmlUserStylerDoc->LoadFile();
if (!loadOkay)
{
::MessageBox(NULL, TEXT("Load stylers.xml failed!"), _stylerPath.c_str(), MB_OK);
_pNativeLangSpeaker->messageBox("LoadStylersFailed",
NULL,
TEXT("Load \"$INT_REPLACE$\" failed!"),
TEXT("Load stylers.xml failed"),
MB_OK,
0,
_stylerPath.c_str());
delete _pXmlUserStylerDoc;
_pXmlUserStylerDoc = NULL;
isAllLaoded = false;

View File

@ -1337,14 +1337,13 @@ bool FileManager::loadFileData(Document doc, const TCHAR * filename, char* data,
// As a 32bit application, we cannot allocate 2 buffer of more than INT_MAX size (it takes the whole address space)
if (bufferSizeRequested > INT_MAX)
{
::MessageBox(NULL, TEXT("File is too big to be opened by Notepad++"), TEXT("File size problem"), MB_OK|MB_APPLMODAL);
/*
_nativeLangSpeaker.messageBox("NbFileToOpenImportantWarning",
_pPublicInterface->getHSelf(),
NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance())->getNativeLangSpeaker();
pNativeSpeaker->messageBox("FileTooBigToOpene",
NULL,
TEXT("File is too big to be opened by Notepad++"),
TEXT("File open problem"),
TEXT("File size problem"),
MB_OK|MB_APPLMODAL);
*/
fclose(fp);
return false;
}
@ -1459,7 +1458,12 @@ bool FileManager::loadFileData(Document doc, const TCHAR * filename, char* data,
}
__except(EXCEPTION_EXECUTE_HANDLER) //TODO: should filter correctly for other exceptions; the old filter(GetExceptionCode(), GetExceptionInformation()) was only catching access violations
{
::MessageBox(NULL, TEXT("File is too big to be opened by Notepad++"), TEXT("File open problem"), MB_OK|MB_APPLMODAL);
NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance())->getNativeLangSpeaker();
pNativeSpeaker->messageBox("FileTooBigToOpene",
NULL,
TEXT("File is too big to be opened by Notepad++"),
TEXT("File size problem"),
MB_OK | MB_APPLMODAL);
success = false;
}

View File

@ -815,7 +815,7 @@ INT_PTR CALLBACK FindReplaceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
SendMessage(_shiftTrickUpTip, TTM_SETDELAYTIME, TTDT_AUTOPOP, MAKELPARAM((15000), (0)));
}
generic_string checkboxTip = pNativeSpeaker->getLocalizedStrFromID("1-to-2-buttons-tip");
generic_string checkboxTip = pNativeSpeaker->getLocalizedStrFromID("two-find-buttons-tip");
if (checkboxTip.empty())
checkboxTip = TEXT("2 find buttons mode");

View File

@ -149,8 +149,6 @@ size_t Printer::doPrint(bool justDoIt)
const TCHAR *fontFace = (nppGUI._printSettings._headerFontName != TEXT(""))?nppGUI._printSettings._headerFontName.c_str():TEXT("Arial");
int headerLineHeight = ::MulDiv(fontSize, ptDpi.y, 72);
//TCHAR toto[10];
//::MessageBox(NULL, itoa(nppGUI._printSettings._headerFontStyle, toto, 10), TEXT("header"), MB_OK);
HFONT fontHeader = ::CreateFont(headerLineHeight,
0, 0, 0,
@ -169,7 +167,6 @@ size_t Printer::doPrint(bool justDoIt)
fontWeight = nppGUI._printSettings._footerFontStyle & (FONTSTYLE_BOLD?FW_BOLD:FW_NORMAL);
isFontItalic = nppGUI._printSettings._footerFontStyle & (FONTSTYLE_ITALIC?TRUE:FALSE);
fontFace = (nppGUI._printSettings._footerFontName != TEXT(""))?nppGUI._printSettings._footerFontName.c_str():TEXT("Arial");
//::MessageBox(NULL, itoa(nppGUI._printSettings._footerFontStyle, , 10), TEXT("footer"), MB_OK);
int footerLineHeight = ::MulDiv(fontSize, ptDpi.y, 72);
HFONT fontFooter = ::CreateFont(footerLineHeight,

View File

@ -859,7 +859,6 @@ void TabBarPlus::drawItem(DRAWITEMSTRUCT *pDrawItemStruct)
if (nTab < 0)
{
::MessageBox(NULL, TEXT("nTab < 0"), TEXT(""), MB_OK);
//return ::CallWindowProc(_tabBarDefaultProc, hwnd, Message, wParam, lParam);
}
bool isSelected = (nTab == ::SendMessage(_hSelf, TCM_GETCURSEL, 0, 0));

View File

@ -1100,44 +1100,6 @@ generic_string NativeLangSpeaker::getProjectPanelLangMenuStr(const char * nodeNa
}
return defaultStr;
}
/*
generic_string NativeLangSpeaker::getFileBrowserLangMenuStr(const char * nodeName, int cmdID, const TCHAR *defaultStr) const
{
if (!_nativeLangA) return defaultStr;
TiXmlNodeA *targetNode = _nativeLangA->FirstChild("FileBrowser");
if (!targetNode) return defaultStr;
targetNode = targetNode->FirstChild("Menus");
if (!targetNode) return defaultStr;
targetNode = targetNode->FirstChild(nodeName);
if (!targetNode) return defaultStr;
const char *name = NULL;
for (TiXmlNodeA *childNode = targetNode->FirstChildElement("Item");
childNode;
childNode = childNode->NextSibling("Item"))
{
TiXmlElementA *element = childNode->ToElement();
int id;
const char *idStr = element->Attribute("id", &id);
if (idStr && id == cmdID)
{
name = element->Attribute("name");
break;
}
}
if (name && name[0])
{
WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance();
return wmc->char2wchar(name, _nativeLangEncoding);
}
return defaultStr;
}
*/
generic_string NativeLangSpeaker::getAttrNameStr(const TCHAR *defaultStr, const char *nodeL1Name, const char *nodeL2Name) const
{