diff --git a/scripts/i18n-check.js b/scripts/i18n-check.js index af224c4..17754f9 100644 --- a/scripts/i18n-check.js +++ b/scripts/i18n-check.js @@ -9,25 +9,23 @@ const vm = require('node:vm'); const SITE = path.join(__dirname, '..', 'site'); const LIT = String.raw`'(?:[^'\\\n]|\\.)*'|"(?:[^"\\\n]|\\.)*"|\x60(?:[^\x60\\$]|\\.|\$(?!\{))*\x60`; -const CALL = new RegExp(String.raw`(? vm.runInNewContext(s); +const CALL = new RegExp(String.raw`(? vm.runInContext(s, CTX); -// English keys used by the game, plus calls whose text is not a literal (those cannot be checked). +// English keys used by the game. Calls whose text is not a literal cannot be checked and are skipped. function sourceKeys(html) { - const keys = new Set(), dynamic = []; + const keys = new Set(); const scripts = [...html.matchAll(/