drupal_language_initialize

Versions
mediamosa-21
drupal_language_initialize()

Initialize all the defined language types.

▾ 3 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 includes/install.core.inc
Begin an installation request, modifying the installation state as needed.
locale_uninstall in modules/locale/locale.install
Implements hook_uninstall().

Code

includes/bootstrap.inc, line 2058

<?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);
  }
}
?>