fix: crowdin sync and pretranslate for plugin locales, run plugin tests on release

This commit is contained in:
LukeGus committed 2026-09-30 23:27:34 -05:00
1 parent 1c4b057fd8
commit f8edb5f299
5 files changed
+72 -30

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
import { describe, expect, it } from "vitest";
import { createRequire } from "node:module";
const require = createRequire(import.meta.url);
const { isSourceFile } = require("./crowdin-pretranslate.cjs") as {
isSourceFile: (file: { path?: string }) => boolean;
};
describe("isSourceFile", () => {
it("matches the core and plugin source files", () => {
expect(isSourceFile({ path: "/en.json" })).toBe(true);
expect(isSourceFile({ path: "/plugins/acme-ssl/locales/en.json" })).toBe(
true,
);
});
it("skips anything else", () => {
expect(isSourceFile({ path: "/src/ui/locales/en.json" })).toBe(false);
expect(isSourceFile({ path: "/plugins/a/b/locales/en.json" })).toBe(false);
expect(isSourceFile({ path: "/plugins/acme-ssl/locales/de.json" })).toBe(
false,
);
expect(isSourceFile({})).toBe(false);
});
});