original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Returns a tag by name and sets the locale
  
  @param string $name
  @param string $locale
  @return Tag
docstring_tokens: Returns a tag by name and sets the locale