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

4 calls to drupal_init_language()
install_main in ./install.php
The Drupal installation happens in a series of steps. We begin by verifying that the current environment meets our minimum requirements. We then go on to verify that settings.php is properly configured. From there we connect to the configured database…
locale_uninstall in modules/locale/locale.install
Implementation of hook_uninstall().
update.php in ./update.php
Administrative page for handling updates from one Drupal version to another.
_db_error_page in includes/database.inc
Helper function to show fatal database errors.

File

includes/bootstrap.inc, line 1283
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();
  }
}