]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Language setting fixes:
authorBrion Vibber <brion@pobox.com>
Wed, 3 Mar 2010 20:08:07 +0000 (12:08 -0800)
committerBrion Vibber <brion@pobox.com>
Wed, 3 Mar 2010 20:10:43 +0000 (12:10 -0800)
- switch 'en_US' to 'en', fixes the "admin panel switches to Arabic" bug
- tweak setting descriptions to clarify that most of the time we'll be using browser language
- add a backend switch to disable language detection (should this be exposed to ui?)

actions/siteadminpanel.php
index.php
lib/default.php
lib/util.php

index 8c8f8b3742bf5c28590281c59dc14504c828b521..4b29819b71b0d68532c0e4c691dd60b47213c574 100644 (file)
@@ -277,8 +277,8 @@ class SiteAdminPanelForm extends AdminForm
         $this->unli();
 
         $this->li();
-        $this->out->dropdown('language', _('Language'),
-                             get_nice_language_list(), _('Default site language'),
+        $this->out->dropdown('language', _('Default language'),
+                             get_nice_language_list(), _('Site language when autodetection from browser settings is not available'),
                              false, $this->value('language'));
         $this->unli();
 
index 06ff9900fd5bff24466be4cbd6ee5ffaeb87ac6e..a46bc084d55e729899a8a48fe654adfa58ed5b09 100644 (file)
--- a/index.php
+++ b/index.php
@@ -253,6 +253,7 @@ function main()
     $user = common_current_user();
 
     // initialize language env
+common_log(LOG_DEBUG, "XXX: WAIII");
 
     common_init_language();
 
index 7b50242ae27f9ff5b37996f86348e6d2c7485545..b7216045ce8555a110570e270c9cc4cfe963d4a9 100644 (file)
@@ -40,7 +40,8 @@ $default =
               'logdebug' => false,
               'fancy' => false,
               'locale_path' => INSTALLDIR.'/locale',
-              'language' => 'en_US',
+              'language' => 'en',
+              'langdetect' => true,
               'languages' => get_all_languages(),
               'email' =>
               array_key_exists('SERVER_ADMIN', $_SERVER) ? $_SERVER['SERVER_ADMIN'] : null,
index 46be920fa7940aa671155985170cf5552af77c64..da2799d4f92d23766c464b1e15b4c66ab6704217 100644 (file)
@@ -105,11 +105,13 @@ function common_language()
 
     // Otherwise, find the best match for the languages requested by the
     // user's browser...
-    $httplang = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : null;
-    if (!empty($httplang)) {
-        $language = client_prefered_language($httplang);
-        if ($language)
-          return $language;
+    if (common_config('site', 'langdetect')) {
+        $httplang = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : null;
+        if (!empty($httplang)) {
+            $language = client_prefered_language($httplang);
+            if ($language)
+              return $language;
+        }
     }
 
     // Finally, if none of the above worked, use the site's default...