mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2025-01-11 07:27:58 +00:00
init locale model #14
This commit is contained in:
parent
b269e24561
commit
5e31e0e972
24
src/app/model/locale.php
Normal file
24
src/app/model/locale.php
Normal 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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user