mirror of
https://github.com/zadam/trilium.git
synced 2025-11-10 08:29:00 +01:00
20 lines
754 B
TypeScript
20 lines
754 B
TypeScript
import { LOCALES } from "@triliumnext/commons";
|
|
import { readFileSync } from "fs";
|
|
import { join } from "path";
|
|
import { describe, expect, it } from "vitest";
|
|
|
|
describe("i18n", () => {
|
|
it("translations are valid JSON", () => {
|
|
for (const locale of LOCALES) {
|
|
if (locale.contentOnly || locale.id === "en_rtl") {
|
|
continue;
|
|
}
|
|
|
|
const translationPath = join(__dirname, "..", "translations", locale.id, "translation.json");
|
|
const translationFile = readFileSync(translationPath, { encoding: "utf-8" });
|
|
expect(() => JSON.parse(translationFile), `JSON error while parsing locale '${locale.id}' at "${translationPath}"`)
|
|
.not.toThrow();
|
|
}
|
|
});
|
|
});
|