#818418 by Amitaibu: Fixed Notices on language negotiation callback when trying to force a full bootstrap.

merge-requests/26/head
Angie Byron 2010-09-11 06:24:55 +00:00
parent b06d19e349
commit 452e31f629
1 changed files with 7 additions and 7 deletions

View File

@ -2327,15 +2327,15 @@ function get_t() {
function drupal_language_initialize() {
$types = language_types();
// Ensure the language is correctly returned, even without multilanguage support.
// Ensure the language is correctly returned, even without multilanguage
// support. Also make sure we have a $language fallback, in case a language
// negotiation callback needs to do a full bootstrap.
// Useful for eg. XML/HTML 'lang' attributes.
if (!drupal_multilingual()) {
$default = language_default();
foreach ($types as $type) {
$GLOBALS[$type] = $default;
}
}
else {
if (drupal_multilingual()) {
include_once DRUPAL_ROOT . '/includes/language.inc';
foreach ($types as $type) {
$GLOBALS[$type] = language_initialize($type);