public function setLocale(string $locale)
    {
        if (!in_array($locale, $this->getAvailableLanguages())) {
            throw new LanguageNotFoundException("Language $locale not found.");
        }

        $this->translator->setLocale($locale);
    }
public function setLocale(string $locale)
    {
        if (!in_array($locale, $this->getAvailableLanguages())) {
            throw new LanguageNotFoundException("Language $locale not found.");
        }

        $this->translator->setLocale($locale);
    }
public function setLocale ( string $ locale ) { if ( ! in_array ( $ locale , $ this -> getAvailableLanguages ( ) ) ) { throw new LanguageNotFoundException ( "Language $locale not found." ) ; } $ this -> translator -> setLocale ( $ locale ) ; }
Set new locale.

@param  string $locale

@throws LanguageNotFoundException
Set new locale .