<?php
$required = [
    'title',
    'header.register',
    'header.register_alt',
    'header.register_steps_1',
    'header.register_steps_2',
    'header.register_steps_3',
    'header.welcome',
    'header.cash_balance',
    'header.nav.buy_coins',
    'header.nav.administration',
    'header.nav.logout',
    'nav.home',
    'nav.thegame',
    'nav.media',
    'nav.howto',
    'nav.community',
    'nav.wiki',
    'nav.board',
    'nav.download',
    'nav.account',
    'nav.itemshop',
    'login.title',
    'login.username',
    'login.password',
    'login.btn_login',
    'login.agree_terms',
    'login.forgot_password',
    'login.resend_ack',
    'ranking.title',
    'ranking.players',
    'ranking.guilds',
    'ranking.btn_highscore',
    'footer.imprint',
    'footer.terms',
    'footer.privacy',
];

foreach (['ro', 'en', 'es', 'fr', 'de', 'pl', 'it'] as $lang) {
    echo "\n=== $lang ===\n";
    $file = "$lang/app/main.php";
    if (!file_exists($file)) {
        echo "FILE MISSING!\n";
        continue;
    }
    $data = include($file);
    $missing = [];
    foreach ($required as $key) {
        if (!isset($data[$key])) {
            $missing[] = $key;
        }
    }
    if (empty($missing)) {
        echo "✓ All keys present (" . count($data) . " total)\n";
    } else {
        echo "✗ MISSING " . count($missing) . " keys:\n";
        foreach ($missing as $key) {
            echo "  - $key\n";
        }
    }
}
