Xinax\LaravelGettext\LaravelGettext::getLocale PHP Метод

getLocale() публичный Метод

Gets the Current locale.
public getLocale ( ) : string
Результат string
    public function getLocale()
    {
        return $this->translator->getLocale();
    }

Usage Example

Пример #1
0
 /**
  * Renders the language selector
  * @return string
  */
 public function render($twBoot = false)
 {
     /** @var array $locales */
     $locales = Config::get('laravel-gettext.supported-locales');
     /** @var string $currentLocale */
     $currentLocale = $this->gettext->getLocale();
     switch ($twBoot) {
         case true:
             return $this->renderBootstrap($locales, $currentLocale);
             break;
         default:
             return $this->render($locales, $currentLocale);
     }
 }
All Usage Examples Of Xinax\LaravelGettext\LaravelGettext::getLocale