public function setActive($locale)
    {
        $active = $this->findByLocale($locale);

        if (!$active) {
            throw new Exception(sprintf("Locale '%s' not in list.", $locale));
        }

        // Mark as current locale
        $this->active = $active;

        // Set as global default for other classes
        \Locale::setDefault($active->getLocale());

        return $this;
    }
public function setActive($locale)
    {
        $active = $this->findByLocale($locale);

        if (!$active) {
            throw new Exception(sprintf("Locale '%s' not in list.", $locale));
        }

        // Mark as current locale
        $this->active = $active;

        // Set as global default for other classes
        \Locale::setDefault($active->getLocale());

        return $this;
    }
public function setActive ( $ locale ) { $ active = $ this -> findByLocale ( $ locale ) ; if ( ! $ active ) { throw new Exception ( sprintf ( "Locale '%s' not in list." , $ locale ) ) ; } // Mark as current locale $ this -> active = $ active ; // Set as global default for other classes \ Locale :: setDefault ( $ active -> getLocale ( ) ) ; return $ this ; }
Set the current active locale incl. localization parameters.

@param string|Locale $locale

@return $this
@throws Exception
Set the current active locale incl . localization parameters .