code: public function getUrl($language)
      {
          $lang = ['lang' => $language];
          $query = Hash::merge($this->request->query, $lang);
          $urlArray = Hash::merge($this->request->params['pass'], ['?' => $query]);
  
          return Router::url($urlArray);
      }
docs: Merge current GET parameters with the language string
  
  @param string $language Language
  @return string Url