Merge branch 'main' into feat/backups

This commit is contained in:
2025-06-09 21:25:27 +02:00
7 changed files with 31 additions and 3 deletions

View File

@ -39,4 +39,19 @@ class Language extends BaseController
}
}
public function file(string $file)
{
$locale = $this->request->getLocale(); // es, en, fr…
$path = APPPATH."Language/{$locale}/{$file}.php";
if (! is_file($path)) {
return $this->response->setStatusCode(404);
}
/** @var array $lines */
$lines = require $path; // el array que devuelve tu lang-file
return $this->response->setJSON($lines); // Content-Type: application/json
}
}