public function getLocaleByUrl($url)
    {
        foreach ($this->getLocales() as $locale) {
            if ($locale->getUrl() === $url) {
                return $locale;
            }
        }
    }
public function getLocaleByUrl($url)
    {
        foreach ($this->getLocales() as $locale) {
            if ($locale->getUrl() === $url) {
                return $locale;
            }
        }
    }
public function getLocaleByUrl ( $ url ) { foreach ( $ this -> getLocales ( ) as $ locale ) { if ( $ locale -> getUrl ( ) === $ url ) { return $ locale ; } } }
Returns a Locale object by locale url key
@param  string $url The locale url as set when configuring (defaults to the locale code).
@return Locale
Returns a Locale object by locale url key