Files
homebrew-magic-rpg/tools/check-translations.ts
T
Octoturge a4f8941fca chore: initialize homebrew-magic-rpg monorepo
Consolidates the HbM: RPG project (formerly the loose hbm-books
working folder) into a single repo. ObsidianNotes, foundry-lore, and
foundry-system are wired in as submodules pointing at their existing
Gitea repos. Loose tooling scripts are organized under tools/,
obsolete/one-off scripts (fix_vault.py, generate_mocs.py, debug-*.ts,
write_file_helper.py) and _books/ (superseded by ObsidianNotes) are
excluded via .gitignore rather than deleted. foundryvtt-admin is
excluded pending its own separate repo.
2026-08-17 21:28:50 +02:00

37 lines
1.3 KiB
TypeScript

import { resolve } from 'node:path';
import { readFileSync, writeFileSync } from 'node:fs';
import { walkBook } from '../Foundry-Data/foundry-system/scripts/parsers/book-walker.js';
import { slugify } from '../Foundry-Data/foundry-system/scripts/parsers/helpers.js';
const SPELL_BOOKS = [
'ObsidianNotes/rules/01. Księga Magii.md',
'ObsidianNotes/rules/04. Arcanum Sanguinis.md',
'ObsidianNotes/rules/05. Vivat Patriarcha coccineus!.md',
'ObsidianNotes/rules/02. Klątwa Otchłani.md'
];
const overrides = JSON.parse(readFileSync('Foundry-Data/foundry-system/scripts/parsers/_id-overrides.json', 'utf8'));
const missing = [];
for (const file of SPELL_BOOKS) {
const path = resolve(file);
let blocks;
try {
blocks = walkBook(path);
} catch(e) { continue; }
for (const block of blocks) {
if (!block.fields.some(f => f.key.toLowerCase().includes('próg') || f.key.toLowerCase().includes('poziom trud'))) continue;
let spellName = block.name;
if (spellName === 'Superzaklęcie - Requiem') spellName = 'Requiem';
const slug = slugify(spellName);
if (!overrides[slug]) {
missing.push({ name: spellName, slug });
}
}
}
console.log(`Missing translations: ${missing.length}`);
missing.forEach(m => console.log(`"${m.slug}": "", // ${m.name}`));