Add 'auto' language option. Do not detect language unless it is set to 'auto'.
authorchriskl <chriskl>
Mon, 1 Aug 2005 05:54:22 +0000 (05:54 +0000)
committerchriskl <chriskl>
Mon, 1 Aug 2005 05:54:22 +0000 (05:54 +0000)
HISTORY
conf/config.inc.php-dist
conf/slony.inc.php [deleted file]
libraries/lib.inc.php

diff --git a/HISTORY b/HISTORY
index 5a606049dc7cec000970adf3d027d0c17fe98c35..19a7b9e6aa243737d45d1ff2b7988ac022870945 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -28,6 +28,9 @@ Features
   to avoid executing selects that have write side effects.
 * Allow re-using username and password for all servers - saves re-entering
   username and password for every server in a pool.
+* Make default language 'auto' indicating auto detect.  If a language is
+  deliberately specifed, then that will always be used and no detection will
+  occur.
   
 Bugs
 * Tree Icons are displayed middle instead of top
index db7418e16be590c0577225cf36f166fd0dc3c91e..3ef8ab996aba35cacd8f27d6c9b4c3ecdfeab750 100644 (file)
@@ -4,7 +4,7 @@
         * Central phpPgAdmin configuration.  As a user you may modify the
         * settings here for your particular configuration.
         *
-        * $Id: config.inc.php-dist,v 1.42 2005/06/22 14:21:09 chriskl Exp $
+        * $Id: config.inc.php-dist,v 1.43 2005/08/01 05:54:22 chriskl Exp $
         */
 
        // An example server.  Create as many of these as you wish,
        //$conf['servers'][1]['pg_dumpall_path'] = 'C:\\Program Files\\PostgreSQL\\8.0\\bin\\pg_dumpall.exe';
        //$conf['servers'][1]['slony_support'] = false;
 
-       // Default language for the login screen if there's no translation
-       // matching user's browser request. Eg: 'english', 'polish', etc.
-       $conf['default_lang'] = 'english';
+       // Default language. Eg: 'english', 'polish', etc.  See lang/ directory
+       // for all possibilities. If you specify 'auto' (the default) it will use 
+       // your browser preference.
+       $conf['default_lang'] = 'auto';
        
        // If extra login security is true, then logins via phpPgAdmin with no
        // password or certain usernames (pgsql, postgres, root, administrator)
diff --git a/conf/slony.inc.php b/conf/slony.inc.php
deleted file mode 100755 (executable)
index 5094074..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-
-       /**
-        * Slony plugin configuration
-        *
-        * $Id: slony.inc.php,v 1.2 2005/06/16 14:40:13 chriskl Exp $
-        */
-
-       $conf['slony_enabled'] = true;
-       
-?>
index 899edc876cf8f8a15884ff0a81523a04486c96d3..8e864f510168b0a60cddd9a6ca0c66f233e2f5d0 100644 (file)
@@ -3,7 +3,7 @@
        /**
         * Function library read in upon startup
         *
-        * $Id: lib.inc.php,v 1.101 2005/07/31 09:15:07 chriskl Exp $
+        * $Id: lib.inc.php,v 1.102 2005/08/01 05:54:31 chriskl Exp $
         */
        include_once('decorator.inc.php');
        include_once('./lang/translations.php');
@@ -94,7 +94,6 @@
        }
 
        // Determine language file to import:
-       
        // 1. Check for the language from a request var
        if (isset($_REQUEST['language'])) {
                $_language = strtolower($_REQUEST['language']);
        }
        
        // 3. Check for acceptable languages in HTTP_ACCEPT_LANGUAGE var
-       if (!isset($_language) && isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
+       if (!isset($_language) && $conf['default_lang'] == 'auto' && isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
                // extract acceptable language tags
                // (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4)
                preg_match_all('/\s*([a-z]{1,8}(?:-[a-z]{1,8})*)(?:;q=([01](?:.[0-9]{0,3})?))?\s*(?:,|$)/', strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']), $_m, PREG_SET_ORDER);
                        unset($_acceptLang);
                }
        }
-       
+
        // 4. Otherwise resort to the default set in the config file
-       if (!isset($_language) && isset($appLangFiles[$conf['default_lang']])) {
+       if (!isset($_language) && $conf['default_lang'] != 'auto' && isset($appLangFiles[$conf['default_lang']])) {
                $_language = $conf['default_lang'];
        }
-       
+
        // Import the language file
        if (isset($_language)) {
                include("./lang/recoded/{$_language}.php");