$i18n_php = true;
// This array specifies the available languages.
- $languages[0]["NAME"] = "English";
- $languages[0]["CODE"] = "en";
- $languages[1]["NAME"] = "Norsk";
- $languages[1]["CODE"] = "no";
- $languages[2]["NAME"] = "Deutcsh";
- $languages[2]["CODE"] = "de";
- $languages[2]["NAME"] = "Russian KOI8-R";
- $languages[2]["CODE"] = "ru";
+ $languages["en"]["NAME"] = "English";
+ $languages["no"]["NAME"] = "Norsk";
+ $languages["no"]["CHARSET"] = "iso-8859-1";
+ $languages["de"]["NAME"] = "Deutcsh";
+ $languages["de"]["CHARSET"] = "iso-8859-1";
+ $languages["ru"]["NAME"] = "Russian KOI8-R";
+ $languages["ru"]["CHARSET"] = "koi8-r";
// Decodes a string to the internal encoding from the given charset
function charset_decode ($charset, $string) {
if (!isset($prefs_php))
include ("../functions/prefs.php");
-
- // This is done to ensure that the character set is correct when
- // receiving input from HTTP forms
- if ($default_charset != "")
- header ("Content-Type: text/html; charset=$default_charset");
+ if (!isset($i18n_php))
+ include ("../functions/i18n.php");
// Check to see if gettext is installed
if (function_exists("_")) {
putenv("LANG=$squirrelmail_language");
bindtextdomain("squirrelmail", "../locale/");
textdomain("squirrelmail");
+ $default_charset = $languages[$squirrelmail_language]["CHARSET"];
// Setting cookie to use on the login screen the next time the
// same user logs in.
}
}
+ // This is done to ensure that the character set is correct.
+ if ($default_charset != "")
+ header ("Content-Type: text/html; charset=$default_charset");
+
function displayPageHeader($color, $mailbox) {
/** Here is the header and wrapping table **/
$shortBoxName = readShortMailboxName($mailbox, ".");
echo " <TD WIDTH=80% ALIGN=LEFT>";
echo " <TT><SELECT NAME=language>\n";
- for ($i = 0; $i < count($languages); $i++) {
- if ($languages[$i]["CODE"] == $chosen_language)
- echo " <OPTION SELECTED VALUE=\"".$languages[$i]["CODE"]."\">".$languages[$i]["NAME"]."\n";
+ reset ($languages);
+ while (list($code, $name)=each($languages)) {
+ if ($code==$chosen_language)
+ echo " <OPTION SELECTED VALUE=\"".$code."\">".$languages[$code]["NAME"]."\n";
else
- echo " <OPTION VALUE=\"".$languages[$i]["CODE"]."\">".$languages[$i]["NAME"]."\n";
+ echo " <OPTION VALUE=\"".$code."\">".$languages[$code]["NAME"]."\n";
+
}
echo " </SELECT></TT>";
+
echo " </TD>";
echo " </TR>";
echo "</TABLE>";