Add i18n completion tool.

This commit is contained in:
Florian THIERRY
2024-09-21 12:20:22 +02:00
parent 3935f6ad21
commit b546a0cf01
8 changed files with 665 additions and 10 deletions

View File

@@ -1,19 +1,20 @@
<h1>Your publications</h1>
<h1 i18n>Your publications</h1>
<a [routerLink]="['/publications/new']"
class="new-publication"
matTooltip="Add a new publication"
matTooltipPosition="left">
matTooltipPosition="left"
i18n-matTooltip>
+
</a>
@if ((isLoading$ | async) === true) {
<h2>Publication loading...</h2>
<h2 i18n>Publication loading...</h2>
<mat-spinner></mat-spinner>
} @else {
@if ((isLoaded$ | async) === true) {
<app-publication-list [publications$]="publications$"></app-publication-list>
} @else {
<h2>There is no any publication...</h2>
<h2 i18n>There is no any publication...</h2>
}
}

View File

@@ -40,8 +40,8 @@ export class MyPublicationsService {
this.publicationsSubject.next(publications);
})
.catch(error => {
const errorMessage = 'An error occurred while retrieving your publications...';
this.snackBar.open(errorMessage);
const errorMessage = $localize`An error occurred while retrieving your publications...`;
this.snackBar.open(errorMessage, $localize`Close`, { duration: 5000 });
console.error(errorMessage, error);
})
.finally(() => {
@@ -50,7 +50,7 @@ export class MyPublicationsService {
});
} else {
this.authenticationService.unauthenticate();
this.snackBar.open('You are unauthenticated. Please, log-in first.', 'Close', { duration: 5000 });
this.snackBar.open($localize`You are unauthenticated. Please, log-in first.`, $localize`Close`, { duration: 5000 });
this.router.navigate(['/login']);
}
}