original_string: public function withLocale($locale, $callback)
      {
          if (! $locale) {
              return $callback();
          }
  
          $app = Container::getInstance();
  
          $original = $app->getLocale();
  
          try {
              $app->setLocale($locale);
  
              return $callback();
          } finally {
              $app->setLocale($original);
          }
      }
code: public function withLocale($locale, $callback)
      {
          if (! $locale) {
              return $callback();
          }
  
          $app = Container::getInstance();
  
          $original = $app->getLocale();
  
          try {
              $app->setLocale($locale);
  
              return $callback();
          } finally {
              $app->setLocale($original);
          }
      }
code_tokens: public function withLocale ( $ locale , $ callback ) { if ( ! $ locale ) { return $ callback ( ) ; } $ app = Container :: getInstance ( ) ; $ original = $ app -> getLocale ( ) ; try { $ app -> setLocale ( $ locale ) ; return $ callback ( ) ; } finally { $ app -> setLocale ( $ original ) ; } }
docstring: Run the callback with the given locale.
  
  @param  string   $locale
  @param  \Closure $callback
  @return mixed
docstring_tokens: Run the callback with the given locale .