Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

Skip extensions with own catalog in i18n extract

Juan Denisa850c9500554
diff --git a/frontend/scripts/extract-i18n.mjs b/frontend/scripts/extract-i18n.mjs
index d44c37f4..1a2805d2 100644
--- a/frontend/scripts/extract-i18n.mjs
+++ b/frontend/scripts/extract-i18n.mjs
@@ -20,7 +20,7 @@
// node scripts/extract-i18n.mjs # write en.json
// node scripts/extract-i18n.mjs --check # fail if en.json is out of date
-import { readFileSync, readdirSync, writeFileSync } from 'node:fs';
+import { existsSync, readFileSync, readdirSync, writeFileSync } from 'node:fs';
import { dirname, extname, join, relative, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { parse } from 'espree';
@@ -48,7 +48,14 @@ const SKIP_FILE = /\.(test|spec|stories)\.[jt]sx?$/;
function walk(dir) {
return readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
const path = join(dir, entry.name);
- if (entry.isDirectory()) return SKIP_DIRS.has(entry.name) ? [] : walk(path);
+ // An extension that ships its own locales/en.json (an installed,
+ // git-ignored copy under src/plugins/) owns its keys; collecting them
+ // into core's en.json made the --check fail on machines that have it.
+ if (entry.isDirectory()) {
+ if (SKIP_DIRS.has(entry.name)) return [];
+ if (existsSync(join(path, 'plugin.json')) && existsSync(join(path, 'locales', 'en.json'))) return [];
+ return walk(path);
+ }
if (!['.js', '.jsx'].includes(extname(entry.name))) return [];
if (SKIP_FILE.test(entry.name)) return [];
return [path];