Help with script to naviagte
My site has English and Spanish versions of each page. The folder structure is identical for both, but all Spanish pages are under a /_spanish folder. For example:
/index.htm is English version
/_spanish/index.htm is Spanish version
I'd like to include a button on each page making it easy to swap languages.
The logic is:
onclick parse the current page name
if it does not contain /_spanish/
insert/_spanish/ and go to that page e.g. go from http://mysite.com/index.htm to http://mysite.com/_spanish/index.htm
else (it does contain /_spanish/)
remove /_spanish and go to that page e.g. go from http://mysite.com/_spanish/index.htm to http://mysite.com/index.htm
Thanks in advance for any help.