From f12dfc70298a04c7b41dbece6416c6e98bc3265b Mon Sep 17 00:00:00 2001 From: Florian THIERRY Date: Sat, 21 Sep 2024 21:09:36 +0200 Subject: [PATCH] i18n for files in core package. --- frontend/src/app/core/guard/authentication.guard.ts | 2 +- frontend/src/app/core/interceptor/jwt.interceptor.ts | 2 +- frontend/src/app/core/service/category.service.ts | 2 +- frontend/src/locale/messages-fr.json | 6 ++++-- frontend/src/locale/messages.json | 6 ++++-- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/frontend/src/app/core/guard/authentication.guard.ts b/frontend/src/app/core/guard/authentication.guard.ts index e6c0eb6..d94aec9 100644 --- a/frontend/src/app/core/guard/authentication.guard.ts +++ b/frontend/src/app/core/guard/authentication.guard.ts @@ -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; } } \ No newline at end of file diff --git a/frontend/src/app/core/interceptor/jwt.interceptor.ts b/frontend/src/app/core/interceptor/jwt.interceptor.ts index cbd3f24..52b9f84 100644 --- a/frontend/src/app/core/interceptor/jwt.interceptor.ts +++ b/frontend/src/app/core/interceptor/jwt.interceptor.ts @@ -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); } } \ No newline at end of file diff --git a/frontend/src/app/core/service/category.service.ts b/frontend/src/app/core/service/category.service.ts index 3593dca..2352e88 100644 --- a/frontend/src/app/core/service/category.service.ts +++ b/frontend/src/app/core/service/category.service.ts @@ -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(); } diff --git a/frontend/src/locale/messages-fr.json b/frontend/src/locale/messages-fr.json index ef1bd4b..e39fd55 100644 --- a/frontend/src/locale/messages-fr.json +++ b/frontend/src/locale/messages-fr.json @@ -2,12 +2,15 @@ "locale": "fr-FR", "translations": { "2578598149846191609": "Publication postée par {$INTERPOLATION}", + "3450287383703155559": "Vous n'êtes pas connecté. Veuillez vous connecter avant de réessayer.", + "7819314041543176992": "Fermer", + "5455465794443528807": "You n'êtes pas connecté. Veuillez vous connecter avant de réessayer votre opération.", + "6940115735259407353": "Une erreur est survenue lors du chargement des catégories.", "4011987306265136481": "Déconnexion...", "4869473828758837325": "Dernières publications", "5148998676057880041": "Chargement des publications...", "3688381096110057852": "Il n'y a aucune publication.", "8393632007890629197": "Une erreur est survenue lors du chargement des dernières publications...", - "7819314041543176992": "Fermer", "2454050363478003966": "Connexion", "8138320902772264034": "Adresse email {$START_TAG_SPAN}*{$CLOSE_TAG_SPAN}", "9175472990822669391": "Mot de passe {$START_TAG_SPAN}*{$CLOSE_TAG_SPAN}", @@ -20,7 +23,6 @@ "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.", "2804059545779555969": "Rédaction d'une nouvelle publication", "4229813881636784544": "Publication créée avec succès !", "1772332295232318552": "Une erreur est survenue lors de l'enregistrement de la nouvelle publication.", diff --git a/frontend/src/locale/messages.json b/frontend/src/locale/messages.json index d6b952c..cac7668 100644 --- a/frontend/src/locale/messages.json +++ b/frontend/src/locale/messages.json @@ -2,12 +2,15 @@ "locale": "en-UK", "translations": { "2578598149846191609": "Publication posted by {$INTERPOLATION}", + "3450287383703155559": "You are unauthenticated. Please, log-in first.", + "7819314041543176992": "Close", + "5455465794443528807": "You are unauthenticated. Please, re-authenticate before retrying your action.", + "6940115735259407353": "An error occured while loading categories.", "4011987306265136481": "Disconnection...", "4869473828758837325": "Last publications", "5148998676057880041": "Publications loading...", "3688381096110057852": "No any publication.", "8393632007890629197": "An error occurred while retrieving latest publications...", - "7819314041543176992": "Close", "2454050363478003966": "Login", "8138320902772264034": " Email address {$START_TAG_SPAN}*{$CLOSE_TAG_SPAN}", "9175472990822669391": " Password {$START_TAG_SPAN}*{$CLOSE_TAG_SPAN}", @@ -20,7 +23,6 @@ "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.", "2804059545779555969": "Creation of a new publication", "4229813881636784544": "Publication created succesfully!", "1772332295232318552": "An error occured while saving new publication.",