title: How to use window.location.href.replace to switch language in the href url?
body: <p>I have a link that is used to switch languages in my site. When the user click on the link I want it to direct user to the chinese version of the page that is located inside the /ch/ folder.</p>
  
  <p>For example, when user is on mysite.com/account/en/index.html, when click on the link, user should be redirected to mysite.com/account/ch/index.html</p>
  
  <p>I tried the below code but it is not working. Anyone know a better code?</p>
  
  <pre><code>&lt;li class="lang"&gt;&lt;a id="langswitch" href="javascript: window.location.href.replace('/en/', '/ch/');" &gt;&lt;img src="/images/account/buttons/chinese.jpg" alt="chinese language" align="top" /&gt;&lt;/a&gt;&lt;/li&gt;
  </code></pre>