init locale model #14

This commit is contained in:
ghost 2023-09-26 03:41:55 +03:00
parent b269e24561
commit 5e31e0e972

24
src/app/model/locale.php Normal file
View File

@ -0,0 +1,24 @@
<?php
class AppModelLocale {
private $_locales = [];
public function __construct(object $locales)
{
foreach ($locales as $key => $value)
{
$this->_locales[] = (object)
[
'key' => $key,
'value' => $value[0],
'active' => false !== stripos($_SERVER['HTTP_ACCEPT_LANGUAGE'], $key) ? true : false,
];
}
}
public function getLocales() : object
{
return $this->_locales;
}
}