managarten/memoro/apps/landing/find-untranslated.mjs
Till-JS e7f5f942f3 chore: initial commit - consolidate 4 projects into monorepo
Projects included:
- maerchenzauber (NestJS backend + Expo mobile + SvelteKit web + Astro landing)
- manacore (Expo mobile + SvelteKit web + Astro landing)
- manadeck (NestJS backend + Expo mobile + SvelteKit web)
- memoro (Expo mobile + SvelteKit web + Astro landing)

This commit preserves the current state before monorepo restructuring.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 23:38:24 +01:00

53 lines
1.8 KiB
JavaScript

import { readFile, readdir } from 'fs/promises';
import { join } from 'path';
import { fileURLToPath } from 'url';
import { dirname } from 'path';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const contentDir = join(__dirname, 'src', 'content');
async function findUntranslatedContent() {
const collections = ['guides', 'blog', 'team', 'features'];
for (const collection of collections) {
console.log(`\n🔍 Checking ${collection}...`);
const dePath = join(contentDir, collection, 'de');
const enPath = join(contentDir, collection, 'en');
try {
const deFiles = await readdir(dePath);
const enFiles = await readdir(enPath);
for (const file of deFiles) {
if (!file.endsWith('.mdx')) continue;
const dePath = join(contentDir, collection, 'de', file);
const enPath = join(contentDir, collection, 'en', file);
const deContent = await readFile(dePath, 'utf-8');
const enContent = await readFile(enPath, 'utf-8');
// Extrahiere die Frontmatter
const deFrontmatter = deContent.match(/^---([\s\S]*?)---/)[1];
const enFrontmatter = enContent.match(/^---([\s\S]*?)---/)[1];
// Prüfe, ob die englische Version noch den deutschen Inhalt hat
if (deFrontmatter.includes('"de"') && enFrontmatter.includes('"en"')) {
const deTitle = deFrontmatter.match(/title: "(.*?)"/)[1];
const enTitle = enFrontmatter.match(/title: "(.*?)"/)[1];
if (deTitle === enTitle) {
console.log(`${file} needs translation (same title in both languages)`);
}
}
}
} catch (error) {
console.error(`Error processing ${collection}:`, error);
}
}
}
findUntranslatedContent().catch(console.error);