i18n of publication page.

This commit is contained in:
Florian THIERRY
2024-09-21 12:28:55 +02:00
parent b546a0cf01
commit 36208ef071
4 changed files with 33 additions and 12 deletions

View File

@@ -50,8 +50,9 @@ export class PublicationComponent implements OnInit, OnDestroy {
setTimeout(() => Prism.highlightAll(), 100);
})
.catch(error => {
this.snackBar.open('An error occurred while loading publication...', 'Close', { duration: 5000 });
console.error('An error occurred while loading publication...', error);
const errorMessage = $localize`An error occurred while loading publication...`;
this.snackBar.open(errorMessage, $localize`Close`, { duration: 5000 });
console.error(errorMessage, error);
})
.finally(() => {
this.isLoading = false;
@@ -70,8 +71,8 @@ export class PublicationComponent implements OnInit, OnDestroy {
ConfirmationDialog,
{
data: {
title: 'Publication deletion',
description: 'Are you sure you want to delete this publication?'
title: $localize`Publication deletion`,
description: $localize`Are you sure you want to delete this publication?`
}
}
);
@@ -80,7 +81,7 @@ export class PublicationComponent implements OnInit, OnDestroy {
.subscribe(response => {
if (response && this.publication?.id) {
this.publicationRestService.delete(this.publication.id);
this.snackBar.open('Publication deleted', 'Close', { duration: 5000 });
this.snackBar.open($localize`Publication deleted`, $localize`Close`, { duration: 5000 });
this.location.back();
}
});