public function getLocaleByCode($code)
    {
        $locales = $this->getLocales();
        if (array_key_exists($code, $locales)) {
            return $locales[$code];
        }
    }
public function getLocaleByCode($code)
    {
        $locales = $this->getLocales();
        if (array_key_exists($code, $locales)) {
            return $locales[$code];
        }
    }
public function getLocaleByCode ( $ code ) { $ locales = $ this -> getLocales ( ) ; if ( array_key_exists ( $ code , $ locales ) ) { return $ locales [ $ code ] ; } }
Returns a Locale object by code
@param  string $code The same code used when declaring the locale in the configuration value
@return Locale
Returns a Locale object by code