i18n of publication page.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
@if (isLoading) {
|
||||
<h2 i18n>Publication content loading...</h2>
|
||||
<mat-spinner></mat-spinner>
|
||||
} @else {
|
||||
@if (publication) {
|
||||
@@ -8,7 +9,10 @@
|
||||
<h1>{{ publication.title }}</h1>
|
||||
<h2>{{ publication.description }}</h2>
|
||||
@if (isAuthorAndUserEquals) {
|
||||
<a [routerLink]="['edit']" class="button action" matTooltip="Click to edit the publication">
|
||||
<a [routerLink]="['edit']"
|
||||
class="button action"
|
||||
matTooltip="Click to edit the publication"
|
||||
i18n-mapTooltip>
|
||||
<mat-icon>edit</mat-icon>
|
||||
</a>
|
||||
}
|
||||
@@ -18,14 +22,18 @@
|
||||
<div class="metadata">
|
||||
<img src="/api/pictures/{{ publication.author.image }}" [matTooltip]="publication.author.name" />
|
||||
<div class="posting-data">
|
||||
Publication posted by {{ publication.author.name }}
|
||||
<span i18n>Publication posted by {{ publication.author.name }}</span>
|
||||
<span class="publication-date">
|
||||
({{ publication.creationDate | date: 'short' : 'fr-FR' }})
|
||||
({{ publication.creationDate | date: 'short' }})
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@if (isAuthorAndUserEquals) {
|
||||
<button type="button" (click)="deletePublication()" matTooltip="Click to delete the publication" matTooltipPosition="left">
|
||||
<button type="button"
|
||||
(click)="deletePublication()"
|
||||
matTooltip="Click to delete the publication"
|
||||
matTooltipPosition="left"
|
||||
i18n-mapTooltip>
|
||||
<mat-icon>delete</mat-icon>
|
||||
Delete
|
||||
</button>
|
||||
@@ -34,7 +42,7 @@
|
||||
</div>
|
||||
} @else {
|
||||
<div class="loading-failed">
|
||||
<h1>Publication failed to load...</h1>
|
||||
<h1 i18n>Publication failed to load...</h1>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -20,6 +20,12 @@
|
||||
"1519054954638405159": "Chargement de la liste de vos publications...",
|
||||
"5982957837973242128": "Vous n'avez rien publié...",
|
||||
"6147923540123489141": "Une erreur est survenue lors de la récupération de vos publications...",
|
||||
"3450287383703155559": "Vous n'êtes pas connecté. Veuillez vous connecter avant de réessayer."
|
||||
"3450287383703155559": "Vous n'êtes pas connecté. Veuillez vous connecter avant de réessayer.",
|
||||
"9035578711395348230": "Chargement du contenu de la publication...",
|
||||
"570282468314450588": "La publication n'a pas pu être chargée...",
|
||||
"3861667381167371965": "Une erreur est survenue lors du chargement de la publication...",
|
||||
"3189372093194446122": "Suppression de la publication",
|
||||
"7149611045520326321": "Êtes vous sûr de vouloir supprimer cette publication ?",
|
||||
"4353366709080867962": "Publication supprimée"
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,12 @@
|
||||
"1519054954638405159": "Publication loading...",
|
||||
"5982957837973242128": "There is no any publication...",
|
||||
"6147923540123489141": "An error occurred while retrieving your publications...",
|
||||
"3450287383703155559": "You are unauthenticated. Please, log-in first."
|
||||
"3450287383703155559": "You are unauthenticated. Please, log-in first.",
|
||||
"9035578711395348230": "Publication content loading...",
|
||||
"570282468314450588": "Publication failed to load...",
|
||||
"3861667381167371965": "An error occurred while loading publication...",
|
||||
"3189372093194446122": "Publication deletion",
|
||||
"7149611045520326321": "Are you sure you want to delete this publication?",
|
||||
"4353366709080867962": "Publication deleted"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user