Real Estate Website - Switching between different languages

2 posts by 2 authors in: Forums > CMS Builder
Last Post: October 10, 2013   (RSS)

By andybarn - October 8, 2013

I have searched the forums and cannot seem to find what I want.

I am looking for a code snippet to handle my website "switching" languages. My site www.kevinjonesvillas.com needs to switch between languages (currently Spanish and English but soon to be French and Russian.). I will have flags at the top of each page for each language.

I have kept to a simple sintax so that Spanish pages have  “_es.php”  on the end, French wil have “_fr.php” on the end and Russian “_ru.php”

Live English to Spanish Examples below:-

1)http://www.kevinjonesvillas.com/index.php =
http://www.kevinjonesvillas.com/index_es.php

2)http://www.kevinjonesvillas.com/about-kevin-jones-villas-costa-blanca.php =
http://www.kevinjonesvillas.com/about-kevin-jones-villas-costa-blanca_es.php

3)http://www.kevinjonesvillas.com/the-area-kevin-jones-villas-costa-blanca.php =
http://www.kevinjonesvillas.com/the-area-kevin-jones-villas-costa-blanca_es.php

4)http://www.kevinjonesvillas.com/property/listingDetail.php?KJV11615072-169 = http://www.kevinjonesvillas.com/property/listingDetail_es.php?KJV11615072-169

5)http://www.kevinjonesvillas.com/property/listingDetail_rentals.php?KJVR5004-338
http://www.kevinjonesvillas.com/property/listingDetail_rentals_es.php?KJVR5004-338

All the pages work, I have already carried out the translations.

What I need is a bit of code at the top of each page so that when I click the country flag, the new language page will be delivered depending on the flag clicked.

For instance, if I am on  page

http://www.kevinjonesvillas.com/property/listingDetail_rentals.php?KJVR5004-338 

and click the Spanish flag, I will then get the following Spanish page

http://www.kevinjonesvillas.com/property/listingDetail_rentals_es.php?KJVR5004-338

Thanks, any help appreciated.

Regards

Andy