Browse Source

Make "Cannot open file" message translatable

Fix #13175, close #13190
pull/13211/head
ArkadiuszMichalski 2 years ago committed by Don Ho
parent
commit
a689635037
  1. 7
      PowerEditor/installer/nativeLang/english.xml
  2. 7
      PowerEditor/installer/nativeLang/english_customizable.xml
  3. 22
      PowerEditor/src/NppIO.cpp

7
PowerEditor/installer/nativeLang/english.xml

@ -1310,7 +1310,8 @@ You can re-activate this dialog in Preferences later."/>
<Item id="4" name="Always Yes"/>
</DoSaveAll> <!-- HowToReproduce: Check the 'Enable Save All confirm dialog' checkbox in Preference->MISC, now click 'Save all' -->
</Dialog>
<MessageBox> <!-- $INT_REPLACE$ is a place holder, don't translate it -->
<MessageBox>
<!-- $INT_REPLACE$ and $STR_REPLACE$ are place holders, don't translate these place holders. -->
<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."/>
<SaveCurrentModifWarning title="Save Current Modification" message="You should save the current modification.
@ -1380,6 +1381,8 @@ Do you want to open it?"/>
<CreateNewFileOrNot title="Create new file" message="&quot;$STR_REPLACE$&quot; doesn't exist. Create it?"/>
<CreateNewFileError title="Create new file" message="Cannot create the file &quot;$STR_REPLACE$&quot;."/> <!-- HowToReproduce: this message prevents from system failure. It's hard to reproduce. -->
<OpenFileError title="ERROR" message="Can not open file &quot;$STR_REPLACE$&quot;."/>
<OpenFileNoFolderError title="Cannot open file" message="&quot;$STR_REPLACE1$&quot; cannot be opened:
Folder &quot;$STR_REPLACE2$&quot; doesn't exist."/>
<FileBackupFailed title="File Backup Failed" message="The previous version of the file could not be saved into the backup directory at &quot;$STR_REPLACE$&quot;.
Do you want to save the current file anyways?"/> <!-- HowToReproduce: this message prevents from system failure. It's hard to reproduce. -->
@ -1528,7 +1531,7 @@ Do you want to save your changes before switching themes?"/> <!-- HowToReproduce
</Menus>
</ProjectManager>
<MiscStrings>
<!-- $INT_REPLACE$ and $STR_REPLACE$ are a place holders, don't translate these place holders -->
<!-- $INT_REPLACE$ and $STR_REPLACE$ are place holders, don't translate these place holders. -->
<word-chars-list-tip value="This allows you to include additional character into current word characters while double clicking for selection or searching with &quot;Match whole word only&quot; option checked."/> <!-- HowToReproduce: In "Delimiter" section of Preferences dialog, hover your mouse on the "?" button. -->
<!-- Don't translate "(&quot;EOL custom color&quot;)" -->

7
PowerEditor/installer/nativeLang/english_customizable.xml

@ -1151,7 +1151,8 @@ You can define several column markers by using white space to separate the diffe
<Item id="5" name="N&amp;o to all"/>
</DoSaveOrNot>
</Dialog>
<MessageBox> <!-- $INT_REPLACE$ is a place holder, don't translate it -->
<MessageBox>
<!-- $INT_REPLACE$ and $STR_REPLACE$ are place holders, don't translate these place holders. -->
<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."/>
<SaveCurrentModifWarning title="Save Current Modification" message="You should save the current modification.
@ -1210,6 +1211,8 @@ Do you want to open it?"/>
<CreateNewFileOrNot title="Create new file" message="&quot;$STR_REPLACE$&quot; doesn't exist. Create it?"/>
<CreateNewFileError title="Create new file" message="Cannot create the file &quot;$STR_REPLACE$&quot;."/> <!-- HowToReproduce: this message prevents from system failure. It's hard to reproduce. -->
<OpenFileError title="ERROR" message="Can not open file &quot;$STR_REPLACE$&quot;."/>
<OpenFileNoFolderError title="Cannot open file" message="&quot;$STR_REPLACE1$&quot; cannot be opened:
Folder &quot;$STR_REPLACE2$&quot; doesn't exist."/>
<FileBackupFailed title="File Backup Failed" message="The previous version of the file could not be saved into the backup directory at &quot;$STR_REPLACE$&quot;.
Do you want to save the current file anyways?"/> <!-- HowToReproduce: this message prevents from system failure. It's hard to reproduce. -->
@ -1352,7 +1355,7 @@ Do you want to save your changes before switching themes?"/> <!-- HowToReproduce
</Menus>
</ProjectManager>
<MiscStrings>
<!-- $INT_REPLACE$ and $STR_REPLACE$ are a place holders, don't translate these place holders -->
<!-- $INT_REPLACE$ and $STR_REPLACE$ are place holders, don't translate these place holders. -->
<word-chars-list-tip value="This allows you to include additional character into current word characters while double clicking for selection or searching with &quot;Match whole word only&quot; option checked."/> <!-- HowToReproduce: In "Delimiter" section of Preferences dialog, hover your mouse on the "?" button. -->
<word-chars-list-warning-begin value="Be aware: "/>

22
PowerEditor/src/NppIO.cpp

@ -353,12 +353,22 @@ BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive,
}
else
{
generic_string str2display = TEXT("\"");
str2display += longFileName;
str2display += TEXT("\" cannot be opened:\nFolder \"");
str2display += longFileDir;
str2display += TEXT("\" doesn't exist.");
::MessageBox(_pPublicInterface->getHSelf(), str2display.c_str(), TEXT("Cannot open file"), MB_OK);
generic_string msg, title;
if (!_nativeLangSpeaker.getMsgBoxLang("OpenFileNoFolderError", title, msg))
{
title = TEXT("Cannot open file");
msg = TEXT("\"");
msg += longFileName;
msg += TEXT("\" cannot be opened:\nFolder \"");
msg += longFileDir;
msg += TEXT("\" doesn't exist.");
}
else
{
msg = stringReplace(msg, TEXT("$STR_REPLACE1$"), longFileName);
msg = stringReplace(msg, TEXT("$STR_REPLACE2$"), longFileDir);
}
::MessageBox(_pPublicInterface->getHSelf(), msg.c_str(), title.c_str(), MB_OK);
}
if (!isCreateFileSuccessful)

Loading…
Cancel
Save