Luigi said:
This sounds interesting but it seems to have some disadvantages:
1) How could I include different menus this way?
I would need at least a different menu for each language.
<?php include "menu.php" ?>
where menu.php says:
<ul>
<?php
# what language are we using?
if ($_COOKIE['language'])
{ $lang = $_COOKIE['language']; }
elseif ($_SERVER['HTTP_ACCEPT_LANGUAGE'])
{ $lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'],0,2); }
else
{ $lang = 'en'; }
# if german, do german menu
if ($lang=='de')
{
print '<li><a href="/home.de.php">Ausgangsposition</a>' . "\n";
print '<li><a href="/help.de.php">Hilfe</a>' . "\n";
print '<li><a href="/contact.de.php">Kontact</a>' . "\n";
}
# if french, do french menu
elseif ($lang=='fr')
{
print '<li><a href="/home.fr.php">Page d'accueil</a>'. "\n";
print '<li><a href="/help.fr.php">Aide</a>' . "\n";
print '<li><a href="/contact.fr.php">Contact</a>' . "\n";
}
# otherwise, english
else
{
print '<li><a href="/home.en.php">Home Page</a>'. "\n";
print '<li><a href="/help.en.php">Help</a>' . "\n";
print '<li><a href="/contact.en.php">Contact</a>' . "\n";
}
# whatever language, off the choice to change language:
print '<li><a href="/setlanguagecookie.php?lang=en">English</a>' . "\n";
print '<li><a href="/setlanguagecookie.php?lang=fr">Francais</a>' . "\n";
print '<li><a href="/setlanguagecookie.php?lang=de">Deutsch</a>' . "\n";
?>
</ul>