* Added default language option to config script
authorfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 17 May 2001 13:57:36 +0000 (13:57 +0000)
committerfidian <fidian@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 17 May 2001 13:57:36 +0000 (13:57 +0000)
* Added default language option to sample config file
* Added default language (last resort) to i18n.php

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@1374 7612ce4b-ef26-0410-bec9-ea0150e637f0

config/conf.pl
config/config_default.php
functions/i18n.php

index cc0663585b4e50195fe91546b67e52b33cebb21c..6e4ed0d0c4051b0ef03250d22a053d1dbd5a4095 100755 (executable)
@@ -6,7 +6,7 @@
 #
 # $Id$
 ############################################################              
-$conf_pl_version = "x62";
+$conf_pl_version = "x63";
 
 ############################################################              
 # Some people try to run this as a CGI. That's wrong!
@@ -283,6 +283,7 @@ while (($command ne "q") && ($command ne "Q")) {
       print "2.  Organization Logo    : $WHT$org_logo$NRM\n";
       print "3.  Organization Title   : $WHT$org_title$NRM\n";
       print "4.  Signout Page         : $WHT$signout_page$NRM\n";
+      print "5.  Default Language     : $WHT$squirrelmail_default_language$NRM\n";
       print "\n";
       print "R   Return to Main Menu\n";
    } elsif ($menu == 2) {
@@ -452,6 +453,7 @@ while (($command ne "q") && ($command ne "Q")) {
          elsif ($command == 2) { $org_logo   = command2 (); }
          elsif ($command == 3) { $org_title  = command3 (); }
          elsif ($command == 4) { $signout_page  = command4 (); }
+        elsif ($command == 5) { $squirrelmail_default_language = command5(); }
       } elsif ($menu == 2) {
          if    ($command == 1)  { $domain             = command11 (); }
          elsif ($command == 2)  { $imapServerAddress  = command12 (); }
@@ -568,6 +570,23 @@ sub command4 {
    return $new_signout_page;
 }
 
+# Default language
+sub command5 {
+   print "SquirrelMail attempts to set the language in many ways.  If it\n";
+   print "can not figure it out in another way, it will default to this\n";
+   print "language.  Please use the two-letter code for the desired language.\n";
+   print "\n";
+   print "[$WHT$squirrelmail_default_language$NRM]: $WHT";
+   $new_signout_page = <STDIN>;
+   if ($new_signout_page eq "\n") {
+      $new_signout_page = $squirrelmail_default_language;
+   } else {
+      $new_signout_page =~ s/[\r|\n]//g;
+      $new_signout_page =~ s/^\s+$//g;
+   }
+   return $new_signout_page;
+}
+
 ####################################################################################
 
 # domain
index 3b31ce395db7e0119c8da1a984125787b0bf6edd..c1d4fc498730104d5de0b1c502a203e9ebee8c0f 100644 (file)
@@ -16,7 +16,7 @@
 
     // don't change
     global $config_version;
-    $config_version = "x62";
+    $config_version = "x63";
 
 //  Organization's logo picture (blank if none)
     global $org_logo;
 //  This is the title that goes at the top of the browser window
     global $org_title;
     $org_title = "SquirrelMail $version";
+    
+//  Default language
+//  This is the default language.  It is used as a last resort if SquirrelMail
+//  can't figure out which language to display.
+//  Use the two-letter code.
+    global $squirrelmail_default_language;
+    $squirrelmail_default_language = 'en';
 
 //  The server that your imap server is on
     global $imapServerAddress, $imapPort;
@@ -70,6 +77,7 @@
 //  cyrus
 //  exchange
 //  uw
+//  other
     global $imap_server_type;
     $imap_server_type = "cyrus";
 
index 0c30fa19efad4f57ab166eb2433ee9c98fe06eaa..17c74909908b2a3ca4ebfd5deec113fa99cac5df 100644 (file)
    {
       static $SetupAlready = 0;
       global $HTTP_ACCEPT_LANGUAGE, $use_gettext, $languages, 
-          $squirrelmail_language;
+          $squirrelmail_language, $squirrelmail_default_language;
       
       if ($SetupAlready)
          return;
       if ($do_search && ! $sm_language && isset($HTTP_ACCEPT_LANGUAGE)) {
          $sm_language = substr($HTTP_ACCEPT_LANGUAGE, 0, 2);
       }
+      if (! $sm_language && isset($squirrelmail_default_language))
+         $sm_language = $squirrelmail_default_language;
 
       if (isset($sm_language) && $use_gettext &&
           $squirrelmail_language != '' &&