Skip to content

Commit d666ab7

Browse files
committed
Check translations
1 parent 60855cc commit d666ab7

2 files changed

Lines changed: 15 additions & 12 deletions

File tree

client/src/__tests__/locale/en.test.js

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import {expect, test} from 'vitest'
22

3-
import en from "../../locale/en";
4-
import nl from "../../locale/nl";
3+
import en from "../../locale/en.js";
4+
import nl from "../../locale/nl.js";
5+
import {isEmpty} from "../../utils/Utils.js";
56

67
expect.extend({
78
toContainKey(translation, key) {
@@ -13,20 +14,22 @@ expect.extend({
1314
});
1415

1516
test("All translations exists in all bundles", () => {
16-
const disabledTest = true;
17+
const disabledTest = false;
1718
//For now disable this, enable again when translations are more final
1819
if (disabledTest) {
1920
return;
2021
}
2122
const contains = (translation, translationToVerify, keyCollection, parents) => {
22-
Object.keys(translation).forEach(key => {
23-
expect(translationToVerify).toContainKey(key);
24-
const value = translation[key];
25-
keyCollection.push(parents + key);
26-
if (typeof value === "object") {
27-
contains(value, translationToVerify[key], keyCollection, parents + key + ".")
28-
}
29-
});
23+
if (!isEmpty(translation)) {
24+
Object.keys(translation).forEach(key => {
25+
expect(translationToVerify).toContainKey(key);
26+
const value = translation[key];
27+
keyCollection.push(parents + key);
28+
if (typeof value === "object") {
29+
contains(value, translationToVerify[key], keyCollection, parents + key + ".")
30+
}
31+
});
32+
}
3033
};
3134
const keyCollectionEN = [];
3235
contains(en, nl, keyCollectionEN, '');

client/src/locale/nl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ const nl = {
558558
imageToLarge: "Afbeelding is groter dan 2 MB.",
559559
confirm: "Nieuwe logo‑afbeelding instellen",
560560
header: "Bijsnijden van je nieuwe logo‑afbeelding",
561-
DISCLAIMERS: [
561+
disclaimers: [
562562
"png, jpg, svg of gif",
563563
"min 100 × 100 pixels",
564564
"max 2 MB."

0 commit comments

Comments
 (0)