Added getCurrentLocale function in Core.php
This commit is contained in:
parent
c38e107515
commit
218ef7a85f
|
|
@ -199,6 +199,21 @@ class Core
|
|||
return $locales = $this->localeRepository->all();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns current locale
|
||||
*
|
||||
* @return Object
|
||||
*/
|
||||
public function getCurrentLocale()
|
||||
{
|
||||
static $locale;
|
||||
|
||||
if ($locale)
|
||||
return $locale;
|
||||
|
||||
return $locale = $this->localeRepository->findOneByField('code', app()->getLocale());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all currencies
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue