original_string: public static function withLanguage(\Closure $callback, $config = [])
      {
          if (\App::runningUnitTests()) {
              $locale = \App::getLocale();
          } else {
              $locale = request()->segment(1);
          }
  
          if (strlen($locale) <= 2) {
              Route::group(['prefix' => $locale, 'middleware' => 'lang'], function () use ($callback) {
                  $callback();
              });
          }
      }
code: public static function withLanguage(\Closure $callback, $config = [])
      {
          if (\App::runningUnitTests()) {
              $locale = \App::getLocale();
          } else {
              $locale = request()->segment(1);
          }
  
          if (strlen($locale) <= 2) {
              Route::group(['prefix' => $locale, 'middleware' => 'lang'], function () use ($callback) {
                  $callback();
              });
          }
      }
code_tokens: public static function withLanguage ( \ Closure $ callback , $ config = [ ] ) { if ( \ App :: runningUnitTests ( ) ) { $ locale = \ App :: getLocale ( ) ; } else { $ locale = request ( ) -> segment ( 1 ) ; } if ( strlen ( $ locale ) <= 2 ) { Route :: group ( [ 'prefix' => $ locale , 'middleware' => 'lang' ] , function ( ) use ( $ callback ) { $ callback ( ) ; } ) ; } }
docstring: Wraps routes with language prefix
  
  @param \Closure $callback
  @param array $config
docstring_tokens: Wraps routes with language prefix