drupal_language_initialize

Versions
7
drupal_language_initialize()

Initialize all the defined language types.

▾ 4 functions call drupal_language_initialize()

drupal_bootstrap in includes/bootstrap.inc
A string describing a phase of Drupal to load. Each phase adds to the previous one, so invoking a later phase automatically runs the earlier phases too. The most important usage is that if you want to access the Drupal database from a script without...
install_begin_request in ./install.php
Begin an installation request, modifying the installation state as needed.
locale_uninstall in modules/locale/locale.install
Implement hook_uninstall().
_db_error_page in includes/database/database.inc
Prints a themed maintenance page with the 'Site offline' text, adding the provided error message in the case of 'display_errors' set to on. Ends the page request; no return.

Code

includes/bootstrap.inc, line 1739

<?php
function drupal_language_initialize() {
  $types = language_types();

  // Ensure the language is correctly returned, even without multilanguage support.
  // Useful for eg. XML/HTML 'lang' attributes.
  if (!drupal_multilingual()) {
    $default = language_default();
    foreach ($types as $type) {
      $GLOBALS[$type] = $default;
    }
  }
  else {
    include_once DRUPAL_ROOT . '/includes/language.inc';
    foreach ($types as $type) {
      $GLOBALS[$type] = language_initialize($type);
    }
    // Allow modules to react on language system initialization in multilingual
    // environments.
    module_invoke_all('language_init', $types);
  }
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.