feat: add automated scripts and JSON datasets for managing and translating site content

This commit is contained in:
Ümit Tunç
2026-05-20 00:03:07 +03:00
parent 29ddc24602
commit 19c9202fc1
14 changed files with 9741 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
<?php
$trPath = __DIR__.'/lang/tr';
$enPath = __DIR__.'/lang/en';
$trFiles = scandir($trPath);
$enFiles = scandir($enPath);
$missingFiles = array_diff($trFiles, $enFiles);
if (!empty($missingFiles)) {
echo "Missing files in lang/en: " . implode(', ', $missingFiles) . "\n";
} else {
echo "All language files exist in both directories.\n";
}
foreach ($trFiles as $file) {
if ($file === '.' || $file === '..') continue;
if (pathinfo($file, PATHINFO_EXTENSION) !== 'php') continue;
$trData = include($trPath.'/'.$file);
$enData = [];
if (file_exists($enPath.'/'.$file)) {
$enData = include($enPath.'/'.$file);
}
$missingKeys = [];
foreach ($trData as $key => $val) {
if (!isset($enData[$key])) {
$missingKeys[] = $key;
}
}
if (!empty($missingKeys)) {
echo "File: $file has missing keys in EN: " . implode(', ', $missingKeys) . "\n";
}
}
echo "Static translation key check completed.\n";