Basically I have a website that is in HTML and some parts javascript!
The website is in english and portuguese: one version is inside a folder called "en" and portuguese is inside a folder "pt".
My idea is to have a flag for both and when I click on it... it will copy the active url, that is displayed in the browser, change "pt" to "en" or "en" to "pt", and then open again in the language that we choose! How can I do to make it working?!
Example: .../en/text.html ===> .../pt/text.html
I was trying...
<script language="javascript">
function getUrl(url)
{ var str = window.location.href;
var url = str.replace("/en/","/pt/");
alert(url);
}</script>
But then what I could do to do it in html code?!
<a href="index.html" target="_self"><img src="../images/flag-pt.jpg"></a>
My question is: How can I get the Url, change it for a new one and then open in the same page?
Thank you a lot, All the best :)