Halo everyone,
Cause I got a website which have many language and each language will have a subdirectory.
for example
1) sample.com/en
2) sample.com/jp
3) sample.com/zh
And the question is, I want the user stay on their curent page, when they change the language.
for example
sample.com/en/about-us (change to)
sample.com/jp/about-us
I have all the button for each language. Just want to use javascript to make each button will go to their own language with their current URL.
When I am in one language "about us" page, other language button link will turn to something like this.
US button > sample.com/en/about-us(base on current URL.)
Japan button> sample.com/jp/about-us (just change the country code with every other botton)
<input type="button" onclick="location.href=window.location.href.replace('en', 'el');" value="Greek" />
I found something like this, but with no luck.
Thanks everyone!!!!