public function getLocale()
    {
        $locale = $this->requestStack->getCurrentRequest() instanceof Request
            ? $this->requestStack->getCurrentRequest()->getLocale()
            : $this->defaultLocale;

        return Locale::create($locale);
    }
public function getLocale()
    {
        $locale = $this->requestStack->getCurrentRequest() instanceof Request
            ? $this->requestStack->getCurrentRequest()->getLocale()
            : $this->defaultLocale;

        return Locale::create($locale);
    }
public function getLocale ( ) { $ locale = $ this -> requestStack -> getCurrentRequest ( ) instanceof Request ? $ this -> requestStack -> getCurrentRequest ( ) -> getLocale ( ) : $ this -> defaultLocale ; return Locale :: create ( $ locale ) ; }
Get usable locale from current request environment.

@return Locale Locale loaded
Get usable locale from current request environment .