public function getTagAndSetLocale($name, $locale = null)
    {
        $tag = $this->getTag($name);

        // Override locale or use tag locale
        // this is for when a tag does not have to be translated
        // and the app locale is determined via route parameter (etiket|tag)
        $locale = $locale ?: $tag->getLocaleForName($name);

        set_app_locale($locale);

        return $tag;
    }
public function getTagAndSetLocale($name, $locale = null)
    {
        $tag = $this->getTag($name);

        // Override locale or use tag locale
        // this is for when a tag does not have to be translated
        // and the app locale is determined via route parameter (etiket|tag)
        $locale = $locale ?: $tag->getLocaleForName($name);

        set_app_locale($locale);

        return $tag;
    }
public function getTagAndSetLocale ( $ name , $ locale = null ) { $ tag = $ this -> getTag ( $ name ) ; // Override locale or use tag locale // this is for when a tag does not have to be translated // and the app locale is determined via route parameter (etiket|tag) $ locale = $ locale ? : $ tag -> getLocaleForName ( $ name ) ; set_app_locale ( $ locale ) ; return $ tag ; }
Returns a tag by name and sets the locale

@param string $name
@param string $locale
@return Tag
Returns a tag by name and sets the locale