2005-04-02 15:51:45 +00:00
|
|
|
<?php
|
|
|
|
require_once("../inc/util.inc");
|
|
|
|
require_once("../inc/translation.inc");
|
|
|
|
$imgdir = "img/flags/";
|
|
|
|
|
|
|
|
|
|
|
|
$languages = getSupportedLanguages();
|
|
|
|
|
|
|
|
if (get_str("set_lang")){
|
|
|
|
if (!in_array(get_str("set_lang"), $languages) && get_str("set_lang")!="auto"){
|
2005-04-02 18:37:22 +00:00
|
|
|
echo "You must select a supported language";
|
|
|
|
exit;
|
2005-04-02 15:51:45 +00:00
|
|
|
} else {
|
2005-04-02 18:37:22 +00:00
|
|
|
setcookie('lang', get_str("set_lang"), time()+3600*24*365);
|
2005-04-05 06:43:58 +00:00
|
|
|
header("Location: index.php");
|
2005-04-02 18:37:22 +00:00
|
|
|
flush();
|
|
|
|
exit;
|
2005-04-02 15:51:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
page_head("Language selection");
|
|
|
|
|
|
|
|
echo "
|
2005-04-02 18:37:22 +00:00
|
|
|
<p>
|
|
|
|
This website is available in the following languages.
|
|
|
|
Normally the choice of language
|
|
|
|
is determined by your web browser's language settings.
|
|
|
|
You can override this by clicking on one of the links.
|
|
|
|
This will send your browser a cookie which
|
|
|
|
stores your language selection on your computer.
|
|
|
|
If you experience any problems please check that your browser accepts
|
|
|
|
cookies from our domain.
|
|
|
|
</p>
|
|
|
|
";
|
2005-04-02 15:51:45 +00:00
|
|
|
echo "<p>The currently selected language is: <em>".tr(LANG_NAME_INTERNATIONAL)."</em> (".tr(LANG_NAME_NATIVE).")</p>";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
start_table();
|
2005-04-05 06:43:58 +00:00
|
|
|
row2("Language symbol", "Language name (click to select)");
|
2005-04-02 15:51:45 +00:00
|
|
|
for ($i=0; $i<sizeof($languages);$i++){
|
|
|
|
$lang_native[$i] = trSpecific(LANG_NAME_NATIVE,$languages[$i]);
|
|
|
|
$lang_international[$i] = trSpecific(LANG_NAME_INTERNATIONAL, $languages[$i]);
|
|
|
|
}
|
|
|
|
|
|
|
|
array_multisort($lang_international, $languages, $lang_native);
|
|
|
|
|
|
|
|
for ($i=0; $i<sizeof($languages);$i++){
|
2005-04-05 06:43:58 +00:00
|
|
|
// if (file_exists($imgdir.$languages[$i].".png")){
|
|
|
|
// $im = "<a href=\"language_select.php?set_lang=".$languages[$i]."\"><img src=\"".$imgdir.$languages[$i].".png\" border=0></a>";
|
|
|
|
// } else {
|
|
|
|
// $im="";
|
|
|
|
// }
|
|
|
|
// row3($im,
|
|
|
|
row2(
|
2005-04-02 18:37:22 +00:00
|
|
|
"<a href=\"language_select.php?set_lang=".$languages[$i]."\">".$languages[$i]."</a>",
|
2005-04-05 21:26:41 +00:00
|
|
|
"<a href=\"language_select.php?set_lang=".$languages[$i]."\">".$lang_international[$i]."</a>"
|
2005-04-02 18:37:22 +00:00
|
|
|
);
|
2005-04-02 15:51:45 +00:00
|
|
|
}
|
|
|
|
end_table();
|
2005-04-05 21:26:41 +00:00
|
|
|
$prefs = $HTTP_SERVER_VARS["HTTP_ACCEPT_LANGUAGE"];
|
|
|
|
echo "
|
|
|
|
<p>
|
|
|
|
For language selection based on your Web browser preferences,
|
|
|
|
<a href=\"language_select.php?set_lang=auto\">click here</a>.
|
|
|
|
<p>
|
|
|
|
Your current Web browser preferences are: <pre>$prefs</pre>
|
2005-04-02 18:37:22 +00:00
|
|
|
";
|
2005-04-02 15:51:45 +00:00
|
|
|
page_tail();
|
|
|
|
?>
|