original_string: public function getLocalBack($language)
      {
          $backUrl = redirect()->back()->getTargetUrl();
          $current = $this->getCurrentLanguage();
          $start = strpos($backUrl, $current);
          $count = strlen($current);
          if ($backUrl[$start - 1] == '/' && (!isset($backUrl[$start + $count])) || $backUrl[$start + $count] == '/') {
              $backUrl = substr_replace($backUrl, $language, $start, $count);
          }
          return $backUrl;
      }
code: public function getLocalBack($language)
      {
          $backUrl = redirect()->back()->getTargetUrl();
          $current = $this->getCurrentLanguage();
          $start = strpos($backUrl, $current);
          $count = strlen($current);
          if ($backUrl[$start - 1] == '/' && (!isset($backUrl[$start + $count])) || $backUrl[$start + $count] == '/') {
              $backUrl = substr_replace($backUrl, $language, $start, $count);
          }
          return $backUrl;
      }
code_tokens: public function getLocalBack ( $ language ) { $ backUrl = redirect ( ) -> back ( ) -> getTargetUrl ( ) ; $ current = $ this -> getCurrentLanguage ( ) ; $ start = strpos ( $ backUrl , $ current ) ; $ count = strlen ( $ current ) ; if ( $ backUrl [ $ start - 1 ] == '/' && ( ! isset ( $ backUrl [ $ start + $ count ] ) ) || $ backUrl [ $ start + $ count ] == '/' ) { $ backUrl = substr_replace ( $ backUrl , $ language , $ start , $ count ) ; } return $ backUrl ; }
docstring: Gets the back route with the correct language
  @param  string $language Language to be replaced
  @return string           string for back url
docstring_tokens: Gets the back route with the correct language