mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2024-12-21 19:08:24 +01:00
Translations for errors
This commit is contained in:
parent
4d017610b8
commit
58278c07ff
@ -965,6 +965,16 @@ multiTool.dragDropMessage=Page(s) Selected
|
||||
multiTool.undo=Undo
|
||||
multiTool.redo=Redo
|
||||
|
||||
#multiTool-decrypt
|
||||
multiTool.decrypt.passwordPrompt=This file is password-protected. Please enter the password:
|
||||
multiTool.decrypt.cancelled=Operation cancelled for PDF: {0}
|
||||
multiTool.decrypt.noPassword=No password provided for encrypted PDF: {0}
|
||||
multiTool.decrypt.invalidPassword=Please try again with the correct password.
|
||||
multiTool.decrypt.invalidPasswordHeader=Incorrect password for PDF: {0}
|
||||
multiTool.decrypt.unexpectedError=There was an error processing the file. Please try again.
|
||||
multiTool.decrypt.serverError=Server error while decrypting: {0}
|
||||
multiTool.decrypt.success=File decrypted successfully.
|
||||
|
||||
#multiTool-advert
|
||||
multiTool-advert.message=This feature is also available in our <a href="{0}">multi-tool page</a>. Check it out for enhanced page-by-page UI and additional features!
|
||||
|
||||
|
@ -6,14 +6,22 @@ export class DecryptFile {
|
||||
if (password === null) {
|
||||
// User cancelled
|
||||
console.error(`Password prompt cancelled for PDF: ${file.name}`);
|
||||
this.showErrorBanner(`Operation cancelled for PDF: ${file.name}`, 'You cancelled the decryption process.');
|
||||
this.showErrorBanner(
|
||||
`${window.translations.cancelled.replace('{0}', file.name)}`,
|
||||
'',
|
||||
`${window.translations.unexpectedError}`
|
||||
);
|
||||
return null; // No file to return
|
||||
}
|
||||
|
||||
if (!password) {
|
||||
// No password provided
|
||||
console.error(`No password provided for encrypted PDF: ${file.name}`);
|
||||
this.showErrorBanner(`No password provided for encrypted PDF: ${file.name}`, 'Please enter a valid password.');
|
||||
this.showErrorBanner(
|
||||
`${window.translations.noPassword.replace('{0}', file.name)}`,
|
||||
'',
|
||||
`${window.translations.unexpectedError}`
|
||||
);
|
||||
return null; // No file to return
|
||||
}
|
||||
|
||||
@ -33,11 +41,11 @@ export class DecryptFile {
|
||||
return new File([decryptedBlob], file.name, {type: 'application/pdf'});
|
||||
} else {
|
||||
const errorText = await response.text();
|
||||
console.error(`Server error while decrypting: ${errorText}`);
|
||||
console.error(`${window.translations.invalidPassword} ${errorText}`);
|
||||
this.showErrorBanner(
|
||||
'Please try again with the correct password.',
|
||||
`${window.translations.invalidPassword}`,
|
||||
errorText,
|
||||
`Incorrect password for PDF: ${file.name}`
|
||||
`${window.translations.invalidPasswordHeader.replace('{0}', file.name)}`
|
||||
);
|
||||
return null; // No file to return
|
||||
}
|
||||
@ -45,9 +53,9 @@ export class DecryptFile {
|
||||
// Handle network or unexpected errors
|
||||
console.error(`Failed to decrypt PDF: ${file.name}`, error);
|
||||
this.showErrorBanner(
|
||||
`Decryption error for PDF: ${file.name}`,
|
||||
error.message || 'Unexpected error occurred.',
|
||||
'There was an error processing the file. Please try again.'
|
||||
`${window.translations.unexpectedError.replace('{0}', file.name)}`,
|
||||
`${error.message || window.translations.unexpectedError}`,
|
||||
error
|
||||
);
|
||||
return null; // No file to return
|
||||
}
|
||||
|
@ -162,7 +162,15 @@
|
||||
insertPageBreak:'[[#{multiTool.insertPageBreak}]]',
|
||||
dragDropMessage:'[[#{multiTool.dragDropMessage}]]',
|
||||
undo: '[[#{multiTool.undo}]]',
|
||||
redo: '[[#{multiTool.redo}]]'
|
||||
redo: '[[#{multiTool.redo}]]',
|
||||
passwordPrompt: '[[#{multiTool.decrypt.passwordPrompt}]]',
|
||||
cancelled: '[[#{multiTool.decrypt.cancelled}]]',
|
||||
noPassword: '[[#{multiTool.decrypt.noPassword}]]',
|
||||
invalidPassword: '[[#{multiTool.decrypt.invalidPassword}]]',
|
||||
invalidPasswordHeader: '[[#{multiTool.decrypt.invalidPasswordHeader}]]',
|
||||
unexpectedError: '[[#{multiTool.decrypt.unexpectedError}]]',
|
||||
serverError: '[[#{multiTool.decrypt.serverError}]]',
|
||||
success: '[[#{multiTool.decrypt.success}]]',
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user