mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-03-31 17:15:38 +00:00
init locale model #14
This commit is contained in:
parent
b269e24561
commit
5e31e0e972
1 changed files with 24 additions and 0 deletions
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…
Add table
Add a link
Reference in a new issue