From 83e51abd354eb4d640c688fab830071943949c2b Mon Sep 17 00:00:00 2001 From: AzazelN28 Date: Tue, 2 Jul 2024 15:09:31 +0200 Subject: [PATCH] :bug: Fix package.json translation scripts --- frontend/package.json | 2 +- frontend/scripts/find-unused-translations.js | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 56835d511..2bbad53ed 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -28,7 +28,7 @@ "test:run": "node target/tests.cjs", "test:watch": "clojure -M:dev:shadow-cljs watch test", "test": "yarn run test:compile && yarn run test:run", - "translations:validate": "node ./scripts/validate-translations.js", + "translations": "node ./scripts/translations.js", "translations:find-unused": "node ./scripts/find-unused-translations.js", "compile": "node ./scripts/compile.js", "compile:cljs": "clojure -M:dev:shadow-cljs compile main", diff --git a/frontend/scripts/find-unused-translations.js b/frontend/scripts/find-unused-translations.js index 6a02198a4..7770031f5 100644 --- a/frontend/scripts/find-unused-translations.js +++ b/frontend/scripts/find-unused-translations.js @@ -1,8 +1,10 @@ -const fs = require("fs").promises; -const gt = require("gettext-parser"); -const path = require("path"); -const util = require("node:util"); -const execFile = util.promisify(require("node:child_process").execFile); +import gt from "gettext-parser"; +import fs from "node:fs/promises"; +import path from "node:path"; +import util from "node:util"; +import { execFile as execFileCb } from "node:child_process"; + +const execFile = util.promisify(execFileCb); async function processMsgId(msgId) { return execFile("grep", ["-r", "-o", msgId, "./src"]).catch(() => {