Snapshot of main at 9f39a6e1e (2026-11-02)

This commit is contained in:
Ronald Huynen committed 2026-11-02 10:41:47 +01:00
commit 6ccf1792d7
2580 files changed
+1040202

No files matched your search

+51
View File
@@ -0,0 +1,51 @@
<?php
/**
* Sync all language files to have the same keys as en.json
*/
echo "=== SYNCING TRANSLATION KEYS ===\n\n";
$enFile = 'resources/lang/en.json';
$en = json_decode(file_get_contents($enFile), true);
$enCount = count($en);
echo "Source (en.json): {$enCount} keys\n\n";
$locales = ['nl', 'de', 'es', 'fr'];
foreach ($locales as $locale) {
$file = "resources/lang/{$locale}.json";
$data = json_decode(file_get_contents($file), true);
$before = count($data);
// Add missing keys from en.json
$added = 0;
foreach ($en as $key => $value) {
if (!isset($data[$key])) {
$data[$key] = $key; // Use English as placeholder
$added++;
}
}
// Remove keys not in en.json
$removed = 0;
foreach (array_keys($data) as $key) {
if (!isset($en[$key])) {
unset($data[$key]);
$removed++;
}
}
$after = count($data);
// Sort alphabetically
ksort($data);
// Save
file_put_contents($file, json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . PHP_EOL);
echo "{$locale}.json: {$before} → {$after} keys (+{$added} -{$removed})\n";
}
echo "\n✓ All language files synced!\n";