Commit 6940175e authored by catch's avatar catch

Issue #1550866 by cosmicdreams, YesCT, sun, RobLoach: Remove obsolete drupal_language_initialize().

parent 0fb87b2c
......@@ -71,9 +71,6 @@ function authorize_access_allowed() {
\Drupal::moduleHandler()->load('system');
\Drupal::moduleHandler()->load('user');
// Initialize the language system.
drupal_language_initialize();
// Initialize the maintenance theme for this administrative script.
drupal_maintenance_theme();
......
......@@ -1939,15 +1939,6 @@ function drupal_installation_attempted() {
return isset($GLOBALS['install_state']) && empty($GLOBALS['install_state']['installation_finished']);
}
/**
* Initializes all the defined language types and sets the default langcode.
*/
function drupal_language_initialize() {
$language_manager = \Drupal::languageManager();
$language_manager->init();
\Drupal::translation()->setDefaultLangcode($language_manager->getCurrentLanguage()->id);
}
/**
* Returns the language object for a given language type.
*
......
......@@ -3203,10 +3203,6 @@ function _drupal_bootstrap_full($skip = FALSE) {
return;
}
// Initialize language (which can strip path prefix) prior to initializing
// current_path().
drupal_language_initialize();
// Let all modules take action before the menu system handles the request.
// We do not want this while running update.php.
if (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'update') {
......
......@@ -372,8 +372,6 @@ function install_begin_request(&$install_state) {
$container->get('string_translation')
->addTranslator($container->get('string_translator.file_translation'));
// Set up $language, so t() caller functions will still work.
drupal_language_initialize();
// Add in installation language if present.
if (isset($install_state['parameters']['langcode'])) {
\Drupal::translation()->setDefaultLangcode($install_state['parameters']['langcode']);
......
<?php
/**
* @file
* Install, update and uninstall functions for the language module.
*/
/**
* Implements hook_uninstall().
*/
function language_uninstall() {
// Re-initialize the language system so successive calls to t() and other
// functions will not expect languages to be present.
drupal_language_initialize();
}
......@@ -33,9 +33,6 @@ public static function getInfo() {
* @see \Drupal\Core\Language\Language
*/
function testDependencyInjectedNewLanguage() {
// Initialize the language system.
drupal_language_initialize();
$expected = $this->languageManager->getDefaultLanguage();
$result = $this->languageManager->getCurrentLanguage();
foreach ($expected as $property => $value) {
......
......@@ -62,9 +62,6 @@ function setUp() {
// Set language detection to URL.
$edit = array('language_interface[enabled][language-url]' => TRUE);
$this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
// Force languages to be initialized.
drupal_language_initialize();
}
/**
......
......@@ -370,9 +370,6 @@ function update_task_list($active = NULL) {
require_once __DIR__ . '/includes/install.inc';
require_once DRUPAL_ROOT . '/core/modules/system/system.install';
// Set up $language, since the installer components require it.
drupal_language_initialize();
// Set up theme system for the maintenance page.
drupal_maintenance_theme();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment