Initial commit

This commit is contained in:
Ronald Huynen
2026-03-23 21:37:59 +01:00
commit 2547717edb
2193 changed files with 972171 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\File;
class CheckTranslations extends Command
{
protected $signature = 'translations:check';
public function handle()
{
$baseLanguage = config('app.fallback_locale');
$languages = config('app.locales');
$baseFiles = File::files(resource_path("lang/{$baseLanguage}"));
foreach ($baseFiles as $file) {
$filename = $file->getFilename();
$baseTranslations = require $file->getPathname();
foreach ($languages as $language) {
$path = resource_path("lang/{$language}/{$filename}");
if (!File::exists($path)) {
$this->error("Missing file: {$language}/{$filename}");
continue;
}
$translations = require $path;
$missingKeys = array_diff_key($baseTranslations, $translations);
if (!empty($missingKeys)) {
$this->warn("Missing keys in {$language}/{$filename}: " . implode(', ', array_keys($missingKeys)));
}
}
}
}
}