Assuming you've got the translation for everything (every phrase/paragraph) you want on your page, a simple, 3-option language check will present your page in your visitor's language.
1.: On 1st visit, the code will check the browser language of the visitor and display your page accordingly.
2.: If the visitor prefers another language, he/she can choose it from a drop-down menu.
3.: Either way, a cookie is set recording the visitor's chosen language so as to display automatically in this language on subsequent visits. This is the first check to be made by the code on any visit.
1.XXXXXX First, you need the language-selection include (langfile.php):
2.XXXXXX A simple switch/case function will provide the language content to the server, easiest to keep in its own script (langs.php), example:
<?php
switch ($lang){ /*The switch/case function is used to select the $lang language variable that the visitor has selected, or that has been drawn from his cookie or his browser language */
//-------ENGLISH
case 'en':
$Title = "Multilingual Web pages.";
$Mdesc = "Languages, Translation, multilingual multimedia";
$Mkw = "translation, multilingual, audio, video, communication, translate, voiceover";
$intro = "Offer yourself a multilingual website accessible to the REST of the world too!";
// etc.
break;
//-------FRANCAIS
case 'fr':
$Title = "Pages Web multilingue, rich media, multimedia, etc.";
$Mdesc = "toutes les langues en une seule page web";
$Mkw = "langues, traduction, multilingue, communication, traduire";
$intro = "Offrez-vous un site Web accessible au RESTE du monde aussi !";
// etc.
break;
//-------
}
?>
3.XXXXXX Then, at the top of your target page (index.php), call the language-select include:
include ($path."langfile.php"); ?> <!-- includes cookie -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head id="Head">
<?php include ($path."langs.php"); ?>
<title><?php echo "$Title" ?></title>
</head>
<body> <!-- text called from "langs.php" variables -->
<!-- ...etc.etc. -->
</body>