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

@@ -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)));
}
}
}
}
}