feat: add multilingual interface support

This commit is contained in:
2026-07-24 16:00:12 +01:00
parent d2567c59ce
commit 16383c2a3f
10 changed files with 788 additions and 84 deletions
+24
View File
@@ -0,0 +1,24 @@
const test = require("node:test");
const assert = require("node:assert/strict");
const fs = require("node:fs");
const path = require("node:path");
const root = path.resolve(__dirname, "..");
test("the Docker image includes every application script referenced by the page", () => {
const html = fs.readFileSync(path.join(root, "index.html"), "utf8");
const dockerfile = fs.readFileSync(path.join(root, "Dockerfile"), "utf8");
const applicationScripts = [...html.matchAll(/<script src="\.\/([^"]+\.js)"/g)]
.map((match) => match[1])
.filter((scriptPath) => !scriptPath.startsWith("vendor/"));
assert.ok(applicationScripts.length > 0);
applicationScripts.forEach((scriptPath) => {
assert.ok(fs.existsSync(path.join(root, scriptPath)), `${scriptPath} must exist`);
assert.match(
dockerfile,
new RegExp(`^COPY ${scriptPath.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")} \\.\\/$`, "m"),
`${scriptPath} must be copied by the Dockerfile`,
);
});
});