From: garvinhicking Date: Wed, 30 Nov 2005 12:12:26 +0000 (+0000) Subject: Change way of language interpretation. X-Git-Tag: 1.0~262 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=411e4b50c87feda31c5070517dfed4c31ea5536f;p=s9y.git Change way of language interpretation. --- diff --git a/docs/NEWS b/docs/NEWS index e5d82b5..14c88c2 100644 --- 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 diff --git a/include/functions_config.inc.php b/include/functions_config.inc.php index aadec57..5634ceb 100644 --- a/include/functions_config.inc.php +++ b/include/functions_config.inc.php @@ -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])) { diff --git a/serendipity_config.inc.php b/serendipity_config.inc.php index 8543bee..56d459e 100644 --- a/serendipity_config.inc.php +++ b/serendipity_config.inc.php @@ -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'])) {