From 0ab9f16cb3238b82fe53d680fcc902939271c9ee Mon Sep 17 00:00:00 2001 From: Anthony LC Date: Tue, 6 Feb 2024 12:56:12 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=90(app-desk)=20improve=20message=20mi?= =?UTF-8?q?ssing=20translations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Improve the message when a translation is missing in the app, now it will show the key of the missing translation. - It also show the translation that are in crowdin but not in the app. - Add missing translations --- .../apps/desk/src/i18n/translations.json | 44 +++++++++++++++---- .../i18n/__tests__/translations.test.ts | 25 +++++++++-- 2 files changed, 58 insertions(+), 11 deletions(-) diff --git a/src/frontend/apps/desk/src/i18n/translations.json b/src/frontend/apps/desk/src/i18n/translations.json index 0a4a9c1..0b3a097 100644 --- a/src/frontend/apps/desk/src/i18n/translations.json +++ b/src/frontend/apps/desk/src/i18n/translations.json @@ -1,8 +1,9 @@ { - "en": { "translation": {} }, "fr": { "translation": { - "Hello Desk !": "Bonjour Desk !", + "Create a new team": "Créer un nouveau groupe", + "Team name": "Nom du groupe", + "Create a team": "Créer un groupe", "Marianne Logo": "Logo Marianne", "Freedom Equality Fraternity Logo": "Logo Liberté Égalité Fraternité", "Desk Logo": "Logo Desk", @@ -10,22 +11,49 @@ "Access to FAQ": "Accès à la FAQ", "FAQ Icon": "Icône FAQ", "FAQ": "FAQ", + "Profile picture": "Photo du profil", "Access to the cells menu": "Accès au menu cellules", "Cells icon": "Icône Cellules", "Language Icon": "Icône de langue", "Language": "Langue", "Search": "Rechercher", - "Favorite": "Favorite", + "Favorite": "Favoris", "Recent": "Récent", "Contacts": "Contacts", "Groups": "Groupes", - "Help": "Aide", - "Profile picture": "Photo de l'utilisateur", "{{label}} button": "Bouton {{label}}", "{{label}} icon": "Icône {{label}}", - "Team name": "Nom de l’équipe", - "Create Team": "Créer une équipe", - "Create a new team": "Créer un nouveau groupe" + "Recents": "Récents", + "Sort the teams": "Trier les groupes", + "Sort teams icon": "Icône trier les groupes", + "Add a team": "Ajouter un groupe", + "Add team icon": "Icône ajout de groupe", + "Teams icon": "Icône de groupe", + "Empty teams icon": "Icône de groupe vide", + "Something bad happens, please refresh the page": "Une erreur inattendue s'est produite, rechargez la page.", + "0 group to display": "0 groupe à afficher.", + "Create your first team by clicking on the \"Create a new team\" button": "Créez votre premier groupe en cliquant sur le bouton \"Créer un nouveau groupe\".", + "Something bad happens, please retry.": "Une erreur inattendue s'est produite, rechargez la page.", + "0 group to display.": "0 groupe à afficher.", + "Create your first team by clicking on the \"Create a new team\" button.": "Créez votre premier groupe en cliquant sur le bouton \"Créer un nouveau groupe\".", + "Something bad happens, please refresh the page.": "Une erreur inattendue s'est produite, rechargez la page.", + "icon group": "icône groupe", + "Members of “{{teamName}}“": "Membres de “{{teamName}}“", + "Add people to the “{{teamName}}“ group.": "Ajouter des personnes au groupe “{{teamName}}“.", + "{{count}} member_one": "{{count}} membre", + "{{count}} member_many": "{{count}} membres", + "{{count}} member_other": "{{count}} membres", + "Created at {{created_at}}": "Créé le {{created_at}}", + "Last update at {{updated_at}}": "Dernière modification le {{updated_at}}", + "People": "People", + "People Description": "Description de People", + "404 - Page not found": "404 - Page introuvable", + "Panel create new team": "Panneau de création d'un nouveau groupe", + "Name the team": "Nommer le groupe", + "Cancel": "Annuler", + "Create the team": "Créer le groupe", + "Something bad happens, please retry": "Une erreur inattendue s'est produite, rechargez la page.", + "Add people to the “{{teamName}}“ group": "Ajouter des personnes au groupe «{{teamName}}»." } } } diff --git a/src/frontend/packages/i18n/__tests__/translations.test.ts b/src/frontend/packages/i18n/__tests__/translations.test.ts index 7a56058..856ba37 100644 --- a/src/frontend/packages/i18n/__tests__/translations.test.ts +++ b/src/frontend/packages/i18n/__tests__/translations.test.ts @@ -20,9 +20,28 @@ describe('checks all the frontend translation are made', () => { .filter((key) => key !== 'en') .forEach((key) => { const listKeysDesk = Object.keys(jsonDesk[key].translation).sort(); - expect( - listKeysCrowdin.every((element) => listKeysDesk.includes(element)), - ).toBeTruthy(); + const missingKeys = listKeysCrowdin.filter( + (element) => !listKeysDesk.includes(element), + ); + const additionalKeys = listKeysDesk.filter( + (element) => !listKeysCrowdin.includes(element), + ); + + if (missingKeys.length > 0) { + console.log( + `Missing keys in Desk translations that should be translated in Crowdin, got to https://crowdin.com/:`, + missingKeys, + ); + } + + if (additionalKeys.length > 0) { + console.log( + `Additional keys in Desk translations that seems not present in this branch:`, + additionalKeys, + ); + } + + expect(missingKeys.length).toBe(0); }); }); });