trilium/apps/client/src/services/i18n.spec.ts
2025-10-09 19:28:05 +03:00

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