mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-29 14:45:24 +00:00
fix: crowdin sync and pretranslate for plugin locales, run plugin tests on release
This commit is contained in:
1 parent
1c4b057fd8
commit
f8edb5f299
5 files changed
+72
-30
No files matched your search
@@ -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);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user