Added getCurrentLocale function in Core.php

This commit is contained in:
jitendra 2019-03-14 18:24:02 +05:30
parent c38e107515
commit 218ef7a85f
1 changed files with 15 additions and 0 deletions

View File

@ -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
*