title: Rails: changing locale and keeping page parameters
body: <p>I have a navbar with links to different languages:</p>
  
  <pre><code>&lt;%= link_to t('header.english'), locale: "en" %&gt;
  </code></pre>
  
  <p>The problem is when user tries to switch language on a page which contains additional parameters in the url. Changing locale at this point reloads the page and strips all the additional parameters.</p>
  
  <p>So, how do I pass all the parameters from the current page to the locale switch link?</p>
  
  <p>For example, when </p>
  
  <pre><code>/page/new?param1=1&amp;param2=2
  </code></pre>
  
  <p>is open, and user switches the locale, </p>
  
  <pre><code>/page/new?locale=en
  </code></pre>
  
  <p>is opened, and both additional parameters are stripped away from the url.</p>