[horde] Two problems : language and TOS on first login

Etienne Goyer etienne.goyer at linuxquebec.com
Wed Sep 3 12:43:59 PDT 2003


On Wed, Sep 03, 2003 at 08:54:51PM +0200, Jan Schneider wrote:
> Zitat von Etienne Goyer <etienne.goyer at linuxquebec.com>:
> 
> > Should Horde administrator have control over which language the login
> > form will be displayed in ?
> 
> What do you both think about this compromise:
> 
> If $nls['default']['language'] is empty (and it should be empty by default
> then) we take the language from the users' browsers and fall back to
> English if we can't determine it (which should be very unlikely with these
> days' browsers). If it is set to a language this language will be taken
> unless the user selects another language explicitely on the login page.

This would get my vote.

-- 
Etienne Goyer                    Linux Québec Technologies Inc.
http://www.LinuxQuebec.com       etienne.goyer at linuxquebec.com
-------------- next part --------------
--- nls.php.dist.orig	Wed Sep  3 15:19:52 2003
+++ nls.php.dist	Wed Sep  3 15:42:10 2003
@@ -9,9 +9,10 @@
  ** Defaults
  **/
 
-/* The langauge to fall back on if we cannot determine one any other
-   way (user choice, preferences, HTTP_ACCEPT_LANGUAGE). */
-$nls['defaults']['language'] = 'en_US';
+/* The language to fall back on if we cannot determine one any other
+   way (user choice or preferences).  If empty, we will try to negociate
+   with the browser using HTTP_ACCEPT_LANGUAGE. */
+$nls['defaults']['language'] = '';
 
 /* The charset to fall back on if we cannot determine one any other
    way (chosen language, HTTP_ACCEPT_CHARSETS). */
-------------- next part --------------
--- NLS.php.orig	Wed Sep  3 15:06:11 2003
+++ NLS.php	Wed Sep  3 15:14:51 2003
@@ -44,8 +44,10 @@
         /* Check if we have a language set in a cookie */
         } elseif (isset($_SESSION['horde_language'])) {
             $language = $_SESSION['horde_language'];
-
-        /* Try browser-accepted languages, then default. */
+        /* Use site-wide default, if one is defined */
+        } elseif ($nls['defaults']['language'] != '') {
+            $language = $nls['defaults']['language'];
+        /* Try browser-accepted languages. */
         } elseif (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
             /* The browser supplies a list, so return the first valid one. */
             $browser_langs = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
@@ -61,9 +63,9 @@
             }
         }
 
-        /* No dice auto-detecting, so give them the server default. */
+        /* No dice auto-detecting, default to US English. */
         if (!isset($language)) {
-            $language = $nls['defaults']['language'];
+            $language = 'en_US';
         }
 
         return basename($language);


More information about the horde mailing list