(e.g. <a href="/includes/language_switch.php).
The scipt on the page language_switch.php will take care of the rest.
Here is the code that will be in the language_switch file
<?php
$completeNewURL = "";
$referer = "$HTTP_REFERER ";
$brokenDownReferer = "";
if (stristr($referer, "/en/")){
$brokenDownReferer = str_replace("/en/", "/fr/", $referer);
}else{
$brokenDownReferer = str_replace("/fr/", "/en/", $referer);
}
//These two lines of code will redirect the user to the corresponding
//french/english version of the page they were just on.
//print("$completeNewURL");
$URL="$brokenDownReferer";
header ("Location: $brokenDownReferer");
?>