i18n for files in core package.

This commit is contained in:
Florian THIERRY
2024-09-21 21:09:36 +02:00
parent 98a890e915
commit f12dfc7029
5 changed files with 11 additions and 7 deletions

View File

@@ -12,7 +12,7 @@ export const authenticationGuard: CanActivateFn = () => {
return true;
} else {
router.navigate(['/login']);
snackBar.open('You are unauthenticated. Please, log-in first.', 'Close', { duration: 5000 });
snackBar.open($localize`You are unauthenticated. Please, log-in first.`, $localize`Close`, { duration: 5000 });
return false;
}
}

View File

@@ -83,7 +83,7 @@ export class JwtInterceptor implements HttpInterceptor {
this.router.navigate(['/login']);
this.refreshTokenSubject.next(undefined);
this.authenticationService.unauthenticate();
this.snackBar.open('You are unauthenticated. Please, re-authenticate before retrying your action.', 'Close', { duration: 5000 });
this.snackBar.open($localize`You are unauthenticated. Please, re-authenticate before retrying your action.`, $localize`Close`, { duration: 5000 });
return throwError(() => initialError);
}
}

View File

@@ -18,7 +18,7 @@ export class CategoryService {
if (!this.categories?.length) {
this.categoryRestService.getCategories()
.then(categories => this.categoriesSubject.next(categories))
.catch(error => console.error('An error occured while loading categories.', error));
.catch(error => console.error($localize`An error occured while loading categories.`, error));
}
return this.categoriesSubject.asObservable();
}