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);
|
|
|
|
header("Location: language_select.php");
|
|
|
|
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();
|
|
|
|
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++){
|
|
|
|
if (file_exists($imgdir.$languages[$i].".png")){
|
2005-04-02 18:37:22 +00:00
|
|
|
$im = "<a href=\"language_select.php?set_lang=".$languages[$i]."\"><img height=\"12\" width=\"16\" src=\"".$imgdir.$languages[$i].".png\" border=0></a>";
|
2005-04-02 15:51:45 +00:00
|
|
|
} else {
|
2005-04-02 18:37:22 +00:00
|
|
|
$im="";
|
2005-04-02 15:51:45 +00:00
|
|
|
}
|
|
|
|
row3($im,
|
2005-04-02 18:37:22 +00:00
|
|
|
"<a href=\"language_select.php?set_lang=".$languages[$i]."\">".$languages[$i]."</a>",
|
|
|
|
"<a href=\"language_select.php?set_lang=".$languages[$i]."\">".$lang_international[$i]." (".$lang_native[$i].")</a>"
|
|
|
|
);
|
2005-04-02 15:51:45 +00:00
|
|
|
}
|
|
|
|
end_table();
|
2005-04-02 18:37:22 +00:00
|
|
|
echo "<p>You can always go back to automatic language selection by pressing
|
|
|
|
<a href=\"language_select.php?set_lang=auto\">this link</a></p>
|
|
|
|
";
|
2005-04-02 15:51:45 +00:00
|
|
|
page_tail();
|
|
|
|
?>
|