Skip to content

Commit

Permalink
🌐(app-desk) improve message missing translations
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
AntoLC committed Feb 6, 2024
1 parent aba9bc7 commit 0fb2d4f
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 11 deletions.
25 changes: 17 additions & 8 deletions src/frontend/apps/desk/src/i18n/translations.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
{
"en": { "translation": {} },
"fr": {
"translation": {
"Hello Desk !": "Bonjour Desk !",
"Create a new team": "Créer un nouveau groupe",
"Team name": "Nom du groupe",
"Create Team": "Créer un groupe",
"Marianne Logo": "Logo Marianne",
"Freedom Equality Fraternity Logo": "Logo Liberté Égalité Fraternité",
"Desk Logo": "Logo Desk",
"Desk": "Desk",
"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 équipes",
"Sort teams icon": "Icône trier les groupes",
"Add a team": "Ajouter une équipe",
"Add team icon": "Icône ajout d'une équipe",
"Teams icon": "Icône de groupe",
"Empty teams icon": "Icône de groupe vide",
"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.",
"Create your first group by clicking on the \"Create a new group\" button": "Créez votre premier groupe en cliquant sur le bouton \"Créer un nouveau groupe\".",
"Hello Desk !": "Bonjour Desk !"
}
}
}
26 changes: 23 additions & 3 deletions src/frontend/packages/i18n/__tests__/translations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,29 @@ 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 || additionalKeys.length > 0) {
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);
});
});
});

0 comments on commit 0fb2d4f

Please sign in to comment.