]> git.mjollnir.org Git - s9y.git/commitdiff
Change way of language interpretation.
authorgarvinhicking <garvinhicking>
Wed, 30 Nov 2005 12:12:26 +0000 (12:12 +0000)
committergarvinhicking <garvinhicking>
Wed, 30 Nov 2005 12:12:26 +0000 (12:12 +0000)
docs/NEWS
include/functions_config.inc.php
serendipity_config.inc.php

index e5d82b585629e9c106c1b0029fe519507ccb3816..14c88c263ba6845f00588c3839db917cf5d760cf 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -3,6 +3,9 @@
 Version 1.0 ()
 ------------------------------------------------------------------------
 
+   * Changed interface language autodetection so that multilingual plugin
+     can override it (garvinhicking)
+
    * Added option to turn off referrer tracking (garvinhicking)
 
    * Improved Smarty Plugin API so that a new function 
index aadec5714b1985a644447baa763c18646ef2e112..5634ceb643fbe6603f4870c1361b4cb0eb06eb25 100644 (file)
@@ -719,10 +719,13 @@ function serendipity_getSessionLanguage() {
     // Store default language
     $serendipity['default_lang'] = $serendipity['lang'];
 
+    // DISABLE THIS!
+/*
     if ($_SESSION['serendipityAuthedUser']) {
         serendipity_header('X-Serendipity-InterfaceLangSource: Database');
         return $serendipity['lang'];
     }
+*/
 
     if (isset($_REQUEST['user_language']) && (!empty($serendipity['languages'][$_REQUEST['user_language']])) && !headers_sent()) {
         serendipity_setCookie('serendipityLanguage', $_REQUEST['user_language']);
@@ -737,6 +740,9 @@ function serendipity_getSessionLanguage() {
     } elseif (serendipity_db_bool($serendipity['lang_content_negotiation'])) {
         serendipity_header('X-Serendipity-InterfaceLangSource: Content-Negotiation');
         $lang = serendipity_detectLang();
+    } elseif ($_SESSION['serendipityAuthedUser']) {
+        serendipity_header('X-Serendipity-InterfaceLangSource: Database');
+        $lang = $serendipity['lang'];
     }
 
     if (!isset($lang) || !isset($serendipity['languages'][$lang])) {
index 8543bee346aadc4161510af6f0bbe334a5ef7f79..56d459e8ee5c00d336cc7faf6bc48f2e9fd0b408 100644 (file)
@@ -204,12 +204,12 @@ if (IS_installed === true) {
     serendipity_login(false);
 }
 
-$serendipity['lang'] = serendipity_getSessionLanguage(); // @see function declaration for todo
-
 if (isset($_SESSION['serendipityAuthorid'])) {
     serendipity_load_configuration($_SESSION['serendipityAuthorid']);
 }
 
+$serendipity['lang'] = serendipity_getSessionLanguage(); // @see function declaration for todo
+
 // Try to fix some path settings. It seems common users have this setting wrong
 // when s9y is installed into the root directory, especially 0.7.1 upgrade users.
 if (empty($serendipity['serendipityHTTPPath'])) {