mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Merge branch 'main' into feat/backups
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user