diff --git a/src/xml/XMLWriter.cpp b/src/xml/XMLWriter.cpp index f4c7cf121..939ba36d9 100644 --- a/src/xml/XMLWriter.cpp +++ b/src/xml/XMLWriter.cpp @@ -321,15 +321,17 @@ void XMLFileWriter::Commit() auto tempPath = GetName(); CloseWithoutEndingTags(); - if (mKeepBackup) { - if (! mBackupFile.Close() || - ! wxRenameFile( mOutputPath, mBackupName ) ) - ThrowException( mBackupName, mCaption ); - } - else { - if ( ! wxRemoveFile( mOutputPath ) ) - ThrowException( mOutputPath, mCaption ); + // JKC: NOT translating error messages. Rationale is that they should + // not be seen, and if they are the untranslated version is more useful to + // developers. + if ( mKeepBackup) { + if (! mBackupFile.Close() || ! wxRenameFile( mOutputPath, mBackupName ) ) + ThrowException( mBackupName, mCaption + " renaming backup"); } + else if (! wxFileExists( mOutputPath ) ); + else if (! wxRemoveFile( mOutputPath ) ) + ThrowException( mOutputPath, mCaption + " removing old version"); + // Now we have vacated the file at the output path and are committed. // But not completely finished with steps of the commit operation.