$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";
+
// Decodes a string to the internal encoding from the given charset
function charset_decode ($charset, $string) {
// All HTML special characters are 7 bit and can be replaced first
$page_header_php = true;
+ 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
header ("Content-Type: text/html; charset=iso-8859-1");
+ // Setting the language to use for gettext if it is not English
+ // (the default language) or empty.
+ if (!isset($squirrelmail_language))
+ $squirrelmail_language = getPref ($data_dir, $username, "language");
+
+ if ($squirrelmail_language != "en" && $squirrelmail_language != "") {
+ putenv("LANG=$use_language");
+ bindtextdomain("squirrelmail", "../locale/");
+ textdomain("squirrelmail");
+
+ // Setting cookie to use on the login screen the next time the
+ // same user logs in.
+ if (!isset($HTTP_COOKIE_VARS["squirrelmail_language"]))
+ setcookie("squirrelmail_language", $squirrelmail_language,
+ time()+2592000);
+ }
+
function displayPageHeader($color, $mailbox) {
/** Here is the header and wrapping table **/
$shortBoxName = readShortMailboxName($mailbox, ".");
<?
include("../config/config.php");
- include("../functions/prefs.php");
+
+ if (!isset($prefs_php))
+ include("../functions/prefs.php");
checkForPrefs($data_dir, $username);
setcookie("username", "", time(), "/");
setcookie("key", "", time(), "/");
setcookie("logged_in", 0, time(), "/");
-?>
-<HTML>
-<?
+
if (!isset($config_php))
include("../config/config.php");
if (!isset($strings_php))
include("../functions/strings.php");
+ if (!isset($page_header_php))
+ include("../functions/page_header.php");
+?>
+<HTML>
+<?
echo "<BODY TEXT=000000 BGCOLOR=FFFFFF LINK=0000CC VLINK=0000CC ALINK=0000CC>\n";
// let's check to see if they compiled with gettext support
include("../functions/imap.php");
if (!isset($array_php))
include("../functions/array.php");
+ if (!isset($i18n_php))
+ include("../functions/i18n.php");
include("../src/load_prefs.php");
$fullname = getPref($data_dir, $username, "full_name");
$replyto = getPref($data_dir, $username, "reply_to");
$email_address = getPref($data_dir, $username, "email_address");
+ $chosen_language = getPref($data_dir, $username, "language");
echo "<TABLE WIDTH=100% COLS=1 ALIGN=CENTER>\n";
echo " <TR><TD BGCOLOR=\"$color[0]\" ALIGN=CENTER>\n";
echo " </SELECT></TT>";
echo " </TD>";
echo " </TR>";
+ // LANGUAGE
+ echo " <TR>";
+ echo " <TD WIDTH=20% ALIGN=RIGHT>";
+ echo " <FONT FACE=\"Arial,Helvetica\">";
+ echo _("Language:");
+ echo " </FONT>";
+ echo " </TD>";
+ 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";
+ else
+ echo " <OPTION VALUE=\"".$languages[$i]["CODE"]."\">".$languages[$i]["NAME"]."\n";
+ }
+ echo " </SELECT></TT>";
+ echo " </TD>";
+ echo " </TR>";
echo "</TABLE>";
setPref($data_dir, $username, "editor_size", $editorsize);
setPref($data_dir, $username, "use_signature", $usesignature);
setPref($data_dir, $username, "left_refresh", $leftrefresh);
+ setPref($data_dir, $username, "language", $language);
setSig($data_dir, $username, stripslashes($signature_edit));