drupal_init_language

6 bootstrap.inc drupal_init_language()

Choose a language for the current page, based on site and user preferences.

4 calls to drupal_init_language()

File

includes/bootstrap.inc, line 1239
Functions that need to be loaded on every Drupal request.

Code

function drupal_init_language() {
  global $language, $user;

  // Ensure the language is correctly returned, even without multilanguage support.
  // Useful for eg. XML/HTML 'lang' attributes.
  if (variable_get('language_count', 1) == 1) {
    $language = language_default();
  }
  else {
    include_once './includes/language.inc';
    $language = language_initialize();
  }
}

Comments

D7

In D7 this has been renamed to drupal_language_initialize.

Login or register to post comments