🌐(app-desk) improve message missing translations

- 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
This commit is contained in:
Anthony LC
2024-02-06 12:56:12 +01:00
committed by Anthony LC
parent c71463a385
commit 0ab9f16cb3
2 changed files with 58 additions and 11 deletions

View File

@@ -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);
});
});
});