managarten/apps/memoro/apps/landing/find-untranslated.mjs
Till JS d8a2b37126 chore(memoro): import legacy backend, mobile, and landing apps
Adds the original NestJS backends (backend, audio-backend), Expo mobile app,
and Astro landing page as-is from the standalone memoro repo. These are
not yet migrated to monorepo standards (migration tracked in memory/CLAUDE.md).

Also adds eslint.config.mjs ignore for apps/*/apps/audio-backend/**
and .prettierignore entries for legacy memoro dirs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-31 17:30:00 +02: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);