Things should now work even if PHP is compiled without gettext support.
authorgustavf <gustavf@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 15 Mar 2000 09:45:52 +0000 (09:45 +0000)
committergustavf <gustavf@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 15 Mar 2000 09:45:52 +0000 (09:45 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@301 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/page_header.php
src/login.php

index 783ed6c204335510574051c5d0c061da3d452335..030a6070acfc34e4ab8c6beaea66d6c4468bd213 100644 (file)
    // receiving input from HTTP forms
    header ("Content-Type: text/html; charset=iso-8859-1");
 
    // 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.
-   $squirrelmail_language = getPref ($data_dir, $username, "language");
-   if ($squirrelmail_language != "en" && $squirrelmail_language != "") {
-      putenv("LANG=$squirrelmail_language");
-      bindtextdomain("squirrelmail", "../locale/");
-      textdomain("squirrelmail");
-
-      // Setting cookie to use on the login screen the next time the
-      // same user logs in.
-      setcookie("squirrelmail_language", $squirrelmail_language, 
-                time()+2592000);
+   // Check to see if gettext is installed
+   if (function_exists("_")) {
+      // Setting the language to use for gettext if it is not English
+      // (the default language) or empty.
+      $squirrelmail_language = getPref ($data_dir, $username, "language");
+      if ($squirrelmail_language != "en" && $squirrelmail_language != "") {
+         putenv("LANG=$squirrelmail_language");
+         bindtextdomain("squirrelmail", "../locale/");
+         textdomain("squirrelmail");
+         
+         // Setting cookie to use on the login screen the next time the
+         // same user logs in.
+         setcookie("squirrelmail_language", $squirrelmail_language, 
+                   time()+2592000);
+      }
+   } else {
+      function _($string) {
+         return $string;
+      }
    }
 
    function displayPageHeader($color, $mailbox) {
    }
 
    function displayPageHeader($color, $mailbox) {
index 64eb4c9055c35f6c5a91eb8877537539f9a2f39a..9a00a2d8786908168943cbfbc490e7001da4a3c4 100644 (file)
    if (!isset($strings_php))
       include("../functions/strings.php");
 
    if (!isset($strings_php))
       include("../functions/strings.php");
 
-   // $squirrelmail_language is set by a cookie when the user selects
-   // language
-   if (isset($squirrelmail_language)) {
-      if ($squirrelmail_language != "en") {
-         putenv("LANG=".$squirrelmail_language);
-         bindtextdomain("squirrelmail", "../locale/");
-         textdomain("squirrelmail");
+   // let's check to see if they compiled with gettext support
+   if (!function_exists("_")) {
+      function _($string) {
+         return $string;
+      }
+   } else {
+      // $squirrelmail_language is set by a cookie when the user selects
+      // language
+      if (isset($squirrelmail_language)) {
+         if ($squirrelmail_language != "en") {
+            putenv("LANG=".$squirrelmail_language);
+            bindtextdomain("squirrelmail", "../locale/");
+            textdomain("squirrelmail");
+         }
       }
    }
 
       }
    }
 
    echo "</TITLE></HEAD>\n";
    echo "<BODY TEXT=000000 BGCOLOR=FFFFFF LINK=0000CC VLINK=0000CC ALINK=0000CC>\n";
  
    echo "</TITLE></HEAD>\n";
    echo "<BODY TEXT=000000 BGCOLOR=FFFFFF LINK=0000CC VLINK=0000CC ALINK=0000CC>\n";
  
-   // let's check to see if they compiled with gettext support
-   if (!function_exists("_")) {
-      echo "<CENTER>PHP was not configured --with-gettext.  Reconfigure and try again.</CENTER></BODY></HTML>";
-      exit;
-   }
-   
    echo "<FORM ACTION=webmail.php METHOD=\"POST\" NAME=f>\n";
    echo "<CENTER><IMG SRC=\"$org_logo\"</CENTER>\n";
    echo "<CENTER><SMALL>";
    echo "<FORM ACTION=webmail.php METHOD=\"POST\" NAME=f>\n";
    echo "<CENTER><IMG SRC=\"$org_logo\"</CENTER>\n";
    echo "<CENTER><SMALL>";