Forum Moderators: phranque
My problem: People who click on a language flag are forced to visit the index file (start page) for each language.
My question: I want to create a link that will 1. Grab my current url 2. add or change the language subfolder to the url without modifying the rest of the current url.
This will allow visitors to stay on the same page but in a different language.
For example. If I'm on a car specific page and the url is:
www.example.com/topics/cars/porche.html
I want readers to be able to click on the Brazilian flag but be taken to the same link but have the /port/ file added to the url:
www.example.com/port/topics/cars/porche.html
Question. Can I create a JavaScript link or something that allows me to use my SSI file to take visitors to specific language sections with the same URL as the previous language?
Here's my SSI file:
<!--Change Language Div -->
<div id="language">
<a href="http://www.example.com/index.html" title="Español"><img src="images/spanishFlag.gif" alt="Spanish Flag" title="Change language to Spanish"></a>
<a href="http://www.example.com/eng/index.html" title="English"><img src="images/english.gif" alt="British Flag" title="Change Language to English"></a>
<a href="http://www.example.com/port/index.html" title="Portuguese"><img src="images/portuguese.gif" alt="Brazilian Flag" title="Change Language to Portuguese"></a>
</div>
<!--End Change Language Div-->