mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2025-01-23 13:14:17 +00:00
update AppModelLocale
This commit is contained in:
parent
0227f0c9ec
commit
f39d3d8ea4
@ -6,27 +6,27 @@ class AppModelLocale {
|
|||||||
|
|
||||||
public function __construct(object $locales)
|
public function __construct(object $locales)
|
||||||
{
|
{
|
||||||
foreach ($locales as $key => $value)
|
foreach ($locales as $code => $value)
|
||||||
{
|
{
|
||||||
$this->_locales[] = (object)
|
$this->_locales[] = (object)
|
||||||
[
|
[
|
||||||
'key' => $key,
|
'code' => $code,
|
||||||
'value' => $value[0],
|
'value' => $value[0],
|
||||||
'active' => false !== stripos($_SERVER['HTTP_ACCEPT_LANGUAGE'], $key) ? true : false,
|
'active' => false,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getLocales() : object
|
public function getList() : object
|
||||||
{
|
{
|
||||||
return (object) $this->_locales;
|
return (object) $this->_locales;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function localeKeyExists(string $key) : bool
|
public function codeExists(string $code) : bool
|
||||||
{
|
{
|
||||||
foreach ($this->_locales as $locale)
|
foreach ($this->_locales as $locale)
|
||||||
{
|
{
|
||||||
if ($locale->key === $key)
|
if ($locale->code === $code)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user