diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index be8c695..5525d81 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -2163,21 +2163,6 @@ function drupal_language_initialize() {
 }
 
 /**
- * Returns the language object for a given language type.
- *
- * @see \Drupal\Core\Language\LanguageManager
- *
- * @param string $type
- *   The type of language object needed, e.g. Language::TYPE_INTERFACE.
- *
- * @deprecated as of Drupal 8.0. Use
- *   \Drupal::languageManager()->getCurrentLanguage().
- */
-function language($type) {
-  return \Drupal::languageManager()->getCurrentLanguage($type);
-}
-
-/**
  * Returns a list of languages set up on the site.
  *
  * @param $flags
diff --git a/core/includes/common.inc b/core/includes/common.inc
index b97cc5e..ddf2c34 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -779,7 +779,7 @@ function filter_xss_bad_protocol($string) {
  * Arbitrary elements may be added using the $args associative array.
  */
 function format_rss_channel($title, $link, $description, $items, $langcode = NULL, $args = array()) {
-  $langcode = $langcode ? $langcode : language(Language::TYPE_CONTENT)->id;
+  $langcode = $langcode ? $langcode : \Drupal::languageManager()->getCurrentLanguage(Language::TYPE_CONTENT)->id;
 
   $output = "<channel>\n";
   $output .= ' <title>' . String::checkPlain($title) . "</title>\n";
diff --git a/core/includes/entity.inc b/core/includes/entity.inc
index 98acf56..bb09ea8 100644
--- a/core/includes/entity.inc
+++ b/core/includes/entity.inc
@@ -120,7 +120,7 @@ function entity_invoke_bundle_hook($hook, $entity_type, $bundle, $bundle_new = N
 function entity_get_form_modes($entity_type = NULL) {
   $form_modes = &drupal_static(__FUNCTION__);
   if (!$form_modes) {
-    $langcode = language(Language::TYPE_INTERFACE)->id;
+    $langcode = \Drupal::languageManager()->getCurrentLanguage()->id;
     if ($cache = cache()->get("entity_form_mode_info:$langcode")) {
       $form_modes = $cache->data;
     }
@@ -158,7 +158,7 @@ function entity_get_form_modes($entity_type = NULL) {
 function entity_get_view_modes($entity_type = NULL) {
   $view_modes = &drupal_static(__FUNCTION__);
   if (!$view_modes) {
-    $langcode = language(Language::TYPE_INTERFACE)->id;
+    $langcode = \Drupal::languageManager()->getCurrentLanguage()->id;
     if ($cache = cache()->get("entity_view_mode_info:$langcode")) {
       $view_modes = $cache->data;
     }
diff --git a/core/includes/form.inc b/core/includes/form.inc
index 5d4a943..f94229f 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -1810,7 +1810,7 @@ function form_validate_table($element, &$form_state) {
  */
 function form_process_machine_name($element, &$form_state) {
   // We need to pass the langcode to the client.
-  $language = language(Language::TYPE_INTERFACE);
+  $language = \Drupal::languageManager()->getCurrentLanguage();
 
   // Apply default form element properties.
   $element += array(
diff --git a/core/includes/menu.inc b/core/includes/menu.inc
index bbf5c43..8f023c4 100644
--- a/core/includes/menu.inc
+++ b/core/includes/menu.inc
@@ -1127,7 +1127,7 @@ function menu_tree_output($tree) {
  */
 function menu_tree_all_data($menu_name, $link = NULL, $max_depth = NULL) {
   $tree = &drupal_static(__FUNCTION__, array());
-  $language_interface = language(Language::TYPE_INTERFACE);
+  $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
   // Use $mlid as a flag for whether the data being loaded is for the whole tree.
   $mlid = isset($link['mlid']) ? $link['mlid'] : 0;
@@ -1238,7 +1238,7 @@ function menu_tree_get_path($menu_name) {
 function menu_tree_page_data($menu_name, $max_depth = NULL, $only_active_trail = FALSE) {
   $tree = &drupal_static(__FUNCTION__, array());
 
-  $language_interface = language(Language::TYPE_INTERFACE);
+  $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
   // Check if the active trail has been overridden for this menu tree.
   $active_path = menu_tree_get_path($menu_name);
@@ -1406,7 +1406,7 @@ function menu_build_tree($menu_name, array $parameters = array()) {
 function _menu_build_tree($menu_name, array $parameters = array()) {
   // Static cache of already built menu trees.
   $trees = &drupal_static(__FUNCTION__, array());
-  $language_interface = language(Language::TYPE_INTERFACE);
+  $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
   // Build the cache id; sort parents to prevent duplicate storage and remove
   // default parameter values.
diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index 144882b..0d8c452 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -2216,7 +2216,7 @@ function template_preprocess_html(&$variables) {
  * @see drupal_render_page()
  */
 function template_preprocess_page(&$variables) {
-  $language_interface = language(Language::TYPE_INTERFACE);
+  $language_interface = \Drupal::languageManager()->getCurrentLanguage();
   $site_config = \Drupal::config('system.site');
 
   // Move some variables to the top level for themer convenience and template cleanliness.
@@ -2391,7 +2391,7 @@ function theme_get_suggestions($args, $base, $delimiter = '__') {
  */
 function template_preprocess_maintenance_page(&$variables) {
   global $theme;
-  $language_interface = language(Language::TYPE_INTERFACE);
+  $language_interface = \Drupal::languageManager()->getCurrentLanguage();
   // Retrieve the theme data to list all available regions.
   $theme_data = list_themes();
   $regions = $theme_data[$theme]->info['regions'];
diff --git a/core/lib/Drupal.php b/core/lib/Drupal.php
index cc68937..16941e5 100644
--- a/core/lib/Drupal.php
+++ b/core/lib/Drupal.php
@@ -431,7 +431,7 @@ public static function urlGenerator() {
    *     displayed outside the site, such as in an RSS feed.
    *   - 'language': An optional language object used to look up the alias
    *     for the URL. If $options['language'] is omitted, the language will be
-   *     obtained from language(Language::TYPE_URL).
+   *     obtained from \Drupal::languageManager()->getCurrentLanguage(Language::TYPE_URL).
    *   - 'https': Whether this URL should point to a secure location. If not
    *     defined, the current scheme is used, so the user stays on HTTP or HTTPS
    *     respectively. if mixed mode sessions are permitted, TRUE enforces HTTPS
diff --git a/core/lib/Drupal/Core/Datetime/DrupalDateTime.php b/core/lib/Drupal/Core/Datetime/DrupalDateTime.php
index 08bdded..2d4be46 100644
--- a/core/lib/Drupal/Core/Datetime/DrupalDateTime.php
+++ b/core/lib/Drupal/Core/Datetime/DrupalDateTime.php
@@ -53,7 +53,7 @@ class DrupalDateTime extends DateTimePlus {
   public function __construct($time = 'now', $timezone = NULL, $settings = array()) {
     // We can set the langcode and country using Drupal values.
     if (!isset($settings['langcode'])) {
-      $settings['langcode'] = language(Language::TYPE_INTERFACE)->id;
+      $settings['langcode'] = \Drupal::languageManager()->getCurrentLanguage()->id;
     }
 
     if (!isset($settings['country'])) {
diff --git a/core/lib/Drupal/Core/Routing/UrlGeneratorInterface.php b/core/lib/Drupal/Core/Routing/UrlGeneratorInterface.php
index a2ce7d1..7a937eb 100644
--- a/core/lib/Drupal/Core/Routing/UrlGeneratorInterface.php
+++ b/core/lib/Drupal/Core/Routing/UrlGeneratorInterface.php
@@ -13,7 +13,7 @@
 /**
  * Defines an interface for generating a url from a route or system path.
  *
- * Provides additional methods and options not present in the base interface. 
+ * Provides additional methods and options not present in the base interface.
  */
 interface UrlGeneratorInterface extends VersatileGeneratorInterface {
 
@@ -55,7 +55,7 @@
    *   - 'language': An optional language object. If the path being linked to is
    *     internal to the site, $options['language'] is used to look up the alias
    *     for the URL. If $options['language'] is omitted, the language will be
-   *     obtained from language(Language::TYPE_URL).
+   *     obtained from \Drupal::languageManager()->getCurrentLanguage(Language::TYPE_URL).
    *   - 'https': Whether this URL should point to a secure location. If not
    *     defined, the current scheme is used, so the user stays on HTTP or HTTPS
    *     respectively. TRUE enforces HTTPS and FALSE enforces HTTP, but HTTPS can
@@ -122,7 +122,7 @@ public function getPathFromRoute($name, $parameters = array());
    *     displayed outside the site, such as in an RSS feed.
    *   - 'language': An optional language object used to look up the alias
    *     for the URL. If $options['language'] is omitted, the language will be
-   *     obtained from language(Language::TYPE_URL).
+   *     obtained from \Drupal::languageManager()->getCurrentLanguage(Language::TYPE_URL).
    *   - 'https': Whether this URL should point to a secure location. If not
    *     defined, the current scheme is used, so the user stays on HTTP or HTTPS
    *     respectively. if mixed mode sessions are permitted, TRUE enforces HTTPS
diff --git a/core/lib/Drupal/Core/Validation/DrupalTranslator.php b/core/lib/Drupal/Core/Validation/DrupalTranslator.php
index df14d94..5b4d99d 100644
--- a/core/lib/Drupal/Core/Validation/DrupalTranslator.php
+++ b/core/lib/Drupal/Core/Validation/DrupalTranslator.php
@@ -56,7 +56,7 @@ public function setLocale($locale) {
    * Implements \Symfony\Component\Translation\TranslatorInterface::getLocale().
    */
   public function getLocale() {
-    return $this->locale ? $this->locale : language(Language::TYPE_INTERFACE)->id;
+    return $this->locale ? $this->locale : \Drupal::languageManager()->getCurrentLanguage()->id;
   }
 
   /**
diff --git a/core/modules/book/book.module b/core/modules/book/book.module
index 8fe9e41..0ad8eaa 100644
--- a/core/modules/book/book.module
+++ b/core/modules/book/book.module
@@ -734,7 +734,7 @@ function template_preprocess_book_navigation(&$variables) {
  */
 function template_preprocess_book_export_html(&$variables) {
   global $base_url;
-  $language_interface = language(Language::TYPE_INTERFACE);
+  $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
   $variables['title'] = check_plain($variables['title']);
   $variables['base_url'] = $base_url;
diff --git a/core/modules/book/lib/Drupal/book/BookManager.php b/core/modules/book/lib/Drupal/book/BookManager.php
index 746a20a..fe29e93 100644
--- a/core/modules/book/lib/Drupal/book/BookManager.php
+++ b/core/modules/book/lib/Drupal/book/BookManager.php
@@ -553,7 +553,7 @@ public function deleteBook($nid) {
    */
   public function bookTreeAllData($menu_name, $link = NULL, $max_depth = NULL) {
     $tree = &drupal_static('menu_tree_all_data', array());
-    $language_interface = language(Language::TYPE_INTERFACE);
+    $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
     // Use $mlid as a flag for whether the data being loaded is for the whole tree.
     $mlid = isset($link['mlid']) ? $link['mlid'] : 0;
@@ -722,7 +722,7 @@ protected function menu_build_tree($menu_name, array $parameters = array()) {
   protected function _menu_build_tree($menu_name, array $parameters = array()) {
     // Static cache of already built menu trees.
     $trees = &drupal_static('menu_build_tree', array());
-    $language_interface = language(Language::TYPE_INTERFACE);
+    $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
     // Build the cache id; sort parents to prevent duplicate storage and remove
     // default parameter values.
diff --git a/core/modules/ckeditor/ckeditor.admin.inc b/core/modules/ckeditor/ckeditor.admin.inc
index d8ef45f..ec34662 100644
--- a/core/modules/ckeditor/ckeditor.admin.inc
+++ b/core/modules/ckeditor/ckeditor.admin.inc
@@ -20,7 +20,7 @@
  */
 function template_preprocess_ckeditor_settings_toolbar(&$variables) {
   // Simplify the language direction information for toolbar buttons.
-  $language_interface = language(Language::TYPE_INTERFACE);
+  $language_interface = \Drupal::languageManager()->getCurrentLanguage(Language::TYPE_CONTENT);
   $language_direction = $language_interface->direction ? 'rtl' : 'ltr';
 
   // Create lists of active and disabled buttons.
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentTokenReplaceTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentTokenReplaceTest.php
index 7b9b9ff..b705472 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentTokenReplaceTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentTokenReplaceTest.php
@@ -26,7 +26,7 @@ public static function getInfo() {
    */
   function testCommentTokenReplacement() {
     $token_service = \Drupal::token();
-    $language_interface = language(Language::TYPE_INTERFACE);
+    $language_interface = \Drupal::languageManager()->getCurrentLanguage();
     $url_options = array(
       'absolute' => TRUE,
       'language' => $language_interface,
diff --git a/core/modules/contact/lib/Drupal/contact/MessageFormController.php b/core/modules/contact/lib/Drupal/contact/MessageFormController.php
index e7012b6..c19c76a 100644
--- a/core/modules/contact/lib/Drupal/contact/MessageFormController.php
+++ b/core/modules/contact/lib/Drupal/contact/MessageFormController.php
@@ -140,7 +140,7 @@ public function preview(array $form, array &$form_state) {
   public function save(array $form, array &$form_state) {
     global $user;
 
-    $language_interface = language(Language::TYPE_INTERFACE);
+    $language_interface = \Drupal::languageManager()->getCurrentLanguage();
     $message = $this->entity;
 
     $sender = clone user_load($user->id());
diff --git a/core/modules/content_translation/content_translation.module b/core/modules/content_translation/content_translation.module
index d981d39..dabc8b4 100644
--- a/core/modules/content_translation/content_translation.module
+++ b/core/modules/content_translation/content_translation.module
@@ -376,7 +376,7 @@ function content_translation_view_access(EntityInterface $entity, $langcode, Acc
  */
 function content_translation_add_access(EntityInterface $entity, Language $source = NULL, Language $target = NULL) {
   $source = !empty($source) ? $source : $entity->language();
-  $target = !empty($target) ? $target : language(Language::TYPE_CONTENT);
+  $target = !empty($target) ? $target : \Drupal::languageManager()->getCurrentLanguage(Language::TYPE_CONTENT);
   $translations = $entity->getTranslationLanguages();
   $languages = language_list();
   return $source->id != $target->id && isset($languages[$source->id]) && isset($languages[$target->id]) && !isset($translations[$target->id]) && content_translation_access($entity, 'create');
@@ -392,7 +392,7 @@ function content_translation_add_access(EntityInterface $entity, Language $sourc
  *   content language.
  */
 function content_translation_edit_access(EntityInterface $entity, Language $language = NULL) {
-  $language = !empty($language) ? $language : language(Language::TYPE_CONTENT);
+  $language = !empty($language) ? $language : \Drupal::languageManager()->getCurrentLanguage(Language::TYPE_CONTENT);
   $translations = $entity->getTranslationLanguages();
   $languages = language_list();
   return isset($languages[$language->id]) && $language->id != $entity->getUntranslated()->language()->id && isset($translations[$language->id]) && content_translation_access($entity, 'update');
@@ -408,7 +408,7 @@ function content_translation_edit_access(EntityInterface $entity, Language $lang
  *   content language.
  */
 function content_translation_delete_access(EntityInterface $entity, Language $language = NULL) {
-  $language = !empty($language) ? $language : language(Language::TYPE_CONTENT);
+  $language = !empty($language) ? $language : \Drupal::languageManager()->getCurrentLanguage(Language::TYPE_CONTENT);
   $translations = $entity->getTranslationLanguages();
   $languages = language_list();
   return isset($languages[$language->id]) && $language->id != $entity->getUntranslated()->language()->id && isset($translations[$language->id]) && content_translation_access($entity, 'delete');
diff --git a/core/modules/content_translation/content_translation.pages.inc b/core/modules/content_translation/content_translation.pages.inc
index 5b3588b..d6c69ab 100644
--- a/core/modules/content_translation/content_translation.pages.inc
+++ b/core/modules/content_translation/content_translation.pages.inc
@@ -182,7 +182,7 @@ function _content_translation_get_switch_links($path) {
  */
 function content_translation_add_page(EntityInterface $entity, Language $source = NULL, Language $target = NULL) {
   $source = !empty($source) ? $source : $entity->language();
-  $target = !empty($target) ? $target : language(Language::TYPE_CONTENT);
+  $target = !empty($target) ? $target : \Drupal::languageManager()->getCurrentLanguage(Language::TYPE_CONTENT);
   // @todo Exploit the upcoming hook_entity_prepare() when available.
   content_translation_prepare_translation($entity, $source, $target);
   $form_state['langcode'] = $target->id;
@@ -207,7 +207,7 @@ function content_translation_add_page(EntityInterface $entity, Language $source
  * @deprecated Use \Drupal\content_translation\Controller\ContentTranslationController::edit()
  */
 function content_translation_edit_page(EntityInterface $entity, Language $language = NULL) {
-  $language = !empty($language) ? $language : language(Language::TYPE_CONTENT);
+  $language = !empty($language) ? $language : \Drupal::languageManager()->getCurrentLanguage(Language::TYPE_CONTENT);
   $form_state['langcode'] = $language->id;
   $form_state['content_translation']['translation_form'] = TRUE;
   return \Drupal::entityManager()->getForm($entity, 'default', $form_state);
diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Access/ContentTranslationManageAccessCheck.php b/core/modules/content_translation/lib/Drupal/content_translation/Access/ContentTranslationManageAccessCheck.php
index 2a9f53b..9f904b4 100644
--- a/core/modules/content_translation/lib/Drupal/content_translation/Access/ContentTranslationManageAccessCheck.php
+++ b/core/modules/content_translation/lib/Drupal/content_translation/Access/ContentTranslationManageAccessCheck.php
@@ -56,7 +56,7 @@ public function access(Route $route, Request $request, AccountInterface $account
           $source = language_load($request->attributes->get('source'));
           $target = language_load($request->attributes->get('target'));
           $source = !empty($source) ? $source : $entity->language();
-          $target = !empty($target) ? $target : language(Language::TYPE_CONTENT);
+          $target = !empty($target) ? $target : \Drupal::languageManager()->getCurrentLanguage(Language::TYPE_CONTENT);
           return ($source->id != $target->id
             && isset($languages[$source->id])
             && isset($languages[$target->id])
@@ -67,7 +67,7 @@ public function access(Route $route, Request $request, AccountInterface $account
         case 'update':
         case 'delete':
           $language = language_load($request->attributes->get('language'));
-          $language = !empty($language) ? $language : language(Language::TYPE_CONTENT);
+          $language = !empty($language) ? $language : \Drupal::languageManager()->getCurrentLanguage(Language::TYPE_CONTENT);
           return isset($languages[$language->id])
             && $language->id != $entity->getUntranslated()->language()->id
             && isset($translations[$language->id])
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileTokenReplaceTest.php b/core/modules/file/lib/Drupal/file/Tests/FileTokenReplaceTest.php
index 9e0039d..61d3988 100644
--- a/core/modules/file/lib/Drupal/file/Tests/FileTokenReplaceTest.php
+++ b/core/modules/file/lib/Drupal/file/Tests/FileTokenReplaceTest.php
@@ -26,7 +26,7 @@ public static function getInfo() {
    */
   function testFileTokenReplacement() {
     $token_service = \Drupal::token();
-    $language_interface = language(Language::TYPE_INTERFACE);
+    $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
     // Create file field.
     $type_name = 'article';
diff --git a/core/modules/language/language.module b/core/modules/language/language.module
index 8d0faab..485b148 100644
--- a/core/modules/language/language.module
+++ b/core/modules/language/language.module
@@ -424,7 +424,7 @@ function language_get_default_langcode($entity_type, $bundle) {
   }
 
   $default_value = NULL;
-  $language_interface = language(Language::TYPE_INTERFACE);
+  $language_interface = \Drupal::languageManager()->getCurrentLanguage();
   switch ($configuration['langcode']) {
     case 'site_default':
       $default_value = language_default()->id;
diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageConfigurationElementTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageConfigurationElementTest.php
index d5a3c02..f74b4b5 100644
--- a/core/modules/language/lib/Drupal/language/Tests/LanguageConfigurationElementTest.php
+++ b/core/modules/language/lib/Drupal/language/Tests/LanguageConfigurationElementTest.php
@@ -83,7 +83,7 @@ public function testDefaultLangcode() {
     // Current interface.
     language_save_default_configuration('custom_type', 'custom_bundle', array('langcode' => 'current_interface', 'language_show' => TRUE));
     $langcode = language_get_default_langcode('custom_type', 'custom_bundle');
-    $language_interface = language(Language::TYPE_INTERFACE);
+    $language_interface = \Drupal::languageManager()->getCurrentLanguage();
     $this->assertEqual($langcode, $language_interface->id);
 
     // Site's default.
diff --git a/core/modules/language/tests/language_test/language_test.module b/core/modules/language/tests/language_test/language_test.module
index 3817137..42f2b0f 100644
--- a/core/modules/language/tests/language_test/language_test.module
+++ b/core/modules/language/tests/language_test/language_test.module
@@ -13,8 +13,8 @@
  */
 function language_test_page_build() {
   language_test_store_language_negotiation();
-  if (isset(language(Language::TYPE_INTERFACE)->id) && isset(language(Language::TYPE_INTERFACE)->method_id)) {
-    drupal_set_message(t('Language negotiation method: @name', array('@name' => language(Language::TYPE_INTERFACE)->method_id)));
+  if (isset(\Drupal::languageManager()->getCurrentLanguage()->id) && isset(\Drupal::languageManager()->getCurrentLanguage()->method_id)) {
+    drupal_set_message(t('Language negotiation method: @name', array('@name' => \Drupal::languageManager()->getCurrentLanguage()->method_id)));
   }
 }
 
diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module
index 21748ae..0219bfa 100644
--- a/core/modules/locale/locale.module
+++ b/core/modules/locale/locale.module
@@ -335,7 +335,7 @@ function locale_translatable_language_list() {
  *   plural formula.
  */
 function locale_get_plural($count, $langcode = NULL) {
-  $language_interface = language(Language::TYPE_INTERFACE);
+  $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
   // Used to locally cache the plural formulas for all languages.
   $plural_formulas = &drupal_static(__FUNCTION__, array());
@@ -603,7 +603,7 @@ function locale_js_alter(&$javascript) {
  *   applicable.
  */
 function locale_js_translate(array $files = array()) {
-  $language_interface = language(Language::TYPE_INTERFACE);
+  $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
   $dir = 'public://' . \Drupal::config('locale.settings')->get('javascript.directory');
   $parsed = \Drupal::state()->get('system.javascript_parsed') ?: array();
@@ -692,7 +692,7 @@ function locale_library_info() {
  */
 function locale_library_info_alter(&$libraries, $module) {
   if ($module == 'system' && isset($libraries['jquery.ui.datepicker'])) {
-    $language_interface = language(Language::TYPE_INTERFACE);
+    $language_interface = \Drupal::languageManager()->getCurrentLanguage();
     // locale.datepicker.js should be added in the JS_LIBRARY group, so that
     // this attach behavior will execute early. JS_LIBRARY is the default for
     // hook_library_info_alter(), thus does not have to be specified explicitly.
@@ -877,7 +877,7 @@ function locale_system_file_system_settings_submit(&$form, $form_state) {
  */
 function locale_preprocess_node(&$variables) {
   if ($variables['node']->language()->id != Language::LANGCODE_NOT_SPECIFIED) {
-    $language_interface = language(Language::TYPE_INTERFACE);
+    $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
     $node_language = $variables['node']->language();
     if ($node_language->id != $language_interface->id) {
@@ -1326,7 +1326,7 @@ function _locale_invalidate_js($langcode = NULL) {
 function _locale_rebuild_js($langcode = NULL) {
   $config = \Drupal::config('locale.settings');
   if (!isset($langcode)) {
-    $language = language(Language::TYPE_INTERFACE);
+    $language = \Drupal::languageManager()->getCurrentLanguage();
   }
   else {
     // Get information about the locale.
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeTokenReplaceTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeTokenReplaceTest.php
index 0834116..e45e6b0 100644
--- a/core/modules/node/lib/Drupal/node/Tests/NodeTokenReplaceTest.php
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeTokenReplaceTest.php
@@ -26,7 +26,7 @@ public static function getInfo() {
    */
   function testNodeTokenReplacement() {
     $token_service = \Drupal::token();
-    $language_interface = language(Language::TYPE_INTERFACE);
+    $language_interface = \Drupal::languageManager()->getCurrentLanguage();
     $url_options = array(
       'absolute' => TRUE,
       'language' => $language_interface,
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index bf79da6..0cc8348 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -332,7 +332,7 @@ function node_type_get_types() {
  *   An array of node type labels, keyed by the node type name.
  */
 function node_type_get_names() {
-  $cid = 'node_type:names:' . language(Language::TYPE_INTERFACE)->id;
+  $cid = 'node_type:names:' . \Drupal::languageManager()->getCurrentLanguage()->id;
   if ($cache = cache()->get($cid)) {
     return $cache->data;
   }
@@ -1207,7 +1207,7 @@ function node_block_access($block) {
  */
 function node_feed($nids = FALSE, $channel = array()) {
   global $base_url;
-  $language_content = language(Language::TYPE_CONTENT);
+  $language_content = \Drupal::languageManager()->getCurrentLanguage(Language::TYPE_CONTENT);
   $rss_config = \Drupal::config('system.rss');
 
   if ($nids === FALSE) {
diff --git a/core/modules/search/search.pages.inc b/core/modules/search/search.pages.inc
index 023a825..8d102f0 100644
--- a/core/modules/search/search.pages.inc
+++ b/core/modules/search/search.pages.inc
@@ -60,7 +60,7 @@ function search_theme_suggestions_search_result(array $variables) {
  *   - content_attributes: HTML attributes for the content.
  */
 function template_preprocess_search_result(&$variables) {
-  $language_interface = language(Language::TYPE_INTERFACE);
+  $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
   $result = $variables['result'];
   $variables['url'] = check_url($result['link']);
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
index b9eb05a..ce37a79 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
@@ -929,7 +929,7 @@ private function prepareEnvironment() {
     // Create the database prefix for this test.
     $this->prepareDatabasePrefix();
 
-    $language_interface = language(Language::TYPE_INTERFACE);
+    $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
     // When running the test runner within a test, back up the original database
     // prefix and re-set the new/nested prefix in drupal_valid_test_ua().
diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php
index f8fa0fe..712c5ab 100644
--- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php
+++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php
@@ -25,7 +25,7 @@ public static function getInfo() {
    * Creates a node, then tests the statistics tokens generated from it.
    */
   function testStatisticsTokenReplacement() {
-    $language_interface = language(Language::TYPE_INTERFACE);
+    $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
     // Create user and node.
     $user = $this->drupalCreateUser(array('create page content'));
diff --git a/core/modules/system/language.api.php b/core/modules/system/language.api.php
index 8684406..ed6de6c 100644
--- a/core/modules/system/language.api.php
+++ b/core/modules/system/language.api.php
@@ -25,7 +25,7 @@
  *   The current path.
  */
 function hook_language_switch_links_alter(array &$links, $type, $path) {
-  $language_interface = language(\Drupal\Core\Language\Language::TYPE_INTERFACE);
+  $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
   if ($type == \Drupal\Core\Language\Language::TYPE_CONTENT && isset($links[$language_interface->id])) {
     foreach ($links[$language_interface->id] as $link) {
@@ -69,7 +69,7 @@ function hook_language_switch_links_alter(array &$links, $type, $path) {
  * Here is a code snippet to transliterate some text:
  * @code
  * // Use the current default interface language.
- * $langcode = language(\Drupal\Core\Language\Language::TYPE_INTERFACE)->id;
+ * $langcode = \Drupal::languageManager()->getCurrentLanguage()->id;
  * // Instantiate the transliteration class.
  * $trans = \Drupal::transliteration();
  * // Use this to transliterate some text.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php
index 4511346..c9ac3bd 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/FormatDateTest.php
@@ -96,7 +96,7 @@ function testAdminDefinedFormatDate() {
   function testFormatDate() {
     global $user;
 
-    $language_interface = language(Language::TYPE_INTERFACE);
+    $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
     $timestamp = strtotime('2007-03-26T00:00:00+00:00');
     $this->assertIdentical(format_date($timestamp, 'custom', 'l, d-M-y H:i:s T', 'America/Los_Angeles', 'en'), 'Sunday, 25-Mar-07 17:00:00 PDT', 'Test all parameters.');
diff --git a/core/modules/system/lib/Drupal/system/Tests/Mail/MailTest.php b/core/modules/system/lib/Drupal/system/Tests/Mail/MailTest.php
index 927b7b1..025c190 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Mail/MailTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Mail/MailTest.php
@@ -50,7 +50,7 @@ function setUp() {
    * Assert that the pluggable mail system is functional.
    */
   public function testPluggableFramework() {
-    $language_interface = language(Language::TYPE_INTERFACE);
+    $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
     // Use MailTestCase for sending a message.
     drupal_mail('simpletest', 'mail_test', 'testing@example.com', $language_interface->id);
@@ -65,7 +65,7 @@ public function testPluggableFramework() {
    * @see simpletest_mail_alter()
    */
   public function testCancelMessage() {
-    $language_interface = language(Language::TYPE_INTERFACE);
+    $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
     // Reset the class variable holding a copy of the last sent message.
     self::$sent_message = NULL;
@@ -81,7 +81,7 @@ public function testCancelMessage() {
    * Checks the From: and Reply-to: headers.
    */
   public function testFromAndReplyToHeader() {
-    global $language;
+    $language = \Drupal::languageManager()->getCurrentLanguage();
 
     // Reset the class variable holding a copy of the last sent message.
     self::$sent_message = NULL;
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceTest.php b/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceTest.php
index 4344801..11bd246 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/TokenReplaceTest.php
@@ -33,7 +33,7 @@ function testTokenReplacement() {
     $node = $this->drupalCreateNode(array('uid' => $account->id()));
     $node->title = '<blink>Blinking Text</blink>';
     global $user;
-    $language_interface = language(Language::TYPE_INTERFACE);
+    $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
     $source  = '[node:title]';         // Title of the node we passed in
     $source .= '[node:author:name]';   // Node author's name
@@ -79,7 +79,7 @@ function testTokenReplacement() {
    */
   function testSystemTokenRecognition() {
     $token_service = \Drupal::token();
-    $language_interface = language(Language::TYPE_INTERFACE);
+    $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
     // Generate prefixes and suffixes for the token context.
     $tests = array(
@@ -109,7 +109,7 @@ function testSystemTokenRecognition() {
    */
   function testSystemSiteTokenReplacement() {
     $token_service = \Drupal::token();
-    $language_interface = language(Language::TYPE_INTERFACE);
+    $language_interface = \Drupal::languageManager()->getCurrentLanguage();
     $url_options = array(
       'absolute' => TRUE,
       'language' => $language_interface,
@@ -153,7 +153,7 @@ function testSystemSiteTokenReplacement() {
    */
   function testSystemDateTokenReplacement() {
     $token_service = \Drupal::token();
-    $language_interface = language(Language::TYPE_INTERFACE);
+    $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
     // Set time to one hour before request.
     $date = REQUEST_TIME - 3600;
diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php
index a3b9d67..7bab220 100644
--- a/core/modules/system/system.api.php
+++ b/core/modules/system/system.api.php
@@ -1529,7 +1529,7 @@ function hook_template_preprocess_default_variables_alter(&$variables) {
  */
 function hook_watchdog(array $log_entry) {
   global $base_url;
-  $language_interface = language(\Drupal\Core\Language\Language::TYPE_INTERFACE);
+  $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
   $severity_list = array(
     WATCHDOG_EMERGENCY     => t('Emergency'),
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index cc647a2..281f728 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -2369,7 +2369,7 @@ function system_page_build(&$page) {
       array(
         'path' => current_path(),
         'front' => drupal_is_front_page(),
-        'language' => language(\Drupal\Core\Language\Language::TYPE_URL)->id,
+        'language' => \Drupal::languageManager()->getCurrentLanguage(\Drupal\Core\Language\Language::TYPE_URL)->id,
         'query' => \Drupal::service('request')->query->all(),
       )
     );
diff --git a/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/CachedMockBlockManager.php b/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/CachedMockBlockManager.php
index 9928a57..29634e2 100644
--- a/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/CachedMockBlockManager.php
+++ b/core/modules/system/tests/modules/plugin_test/lib/Drupal/plugin_test/Plugin/CachedMockBlockManager.php
@@ -25,6 +25,6 @@ public function __construct() {
     // The CacheDecorator allows us to cache these plugin definitions for
     // quicker retrieval. In this case we are generating a cache key by
     // language.
-    $this->discovery = new CacheDecorator($this->discovery, 'mock_block:' . language(Language::TYPE_INTERFACE)->id, 'cache',  1542646800, array('plugin_test'));
+    $this->discovery = new CacheDecorator($this->discovery, 'mock_block:' . \Drupal::languageManager()->getCurrentLanguage()->id, 'cache',  1542646800, array('plugin_test'));
   }
 }
diff --git a/core/modules/system/theme.api.php b/core/modules/system/theme.api.php
index db11a21..139c300 100644
--- a/core/modules/system/theme.api.php
+++ b/core/modules/system/theme.api.php
@@ -235,7 +235,7 @@ function hook_theme_suggestions_HOOK(array $variables) {
  */
 function hook_theme_suggestions_alter(array &$suggestions, array $variables, $hook) {
   // Add an interface-language specific suggestion to all theme hooks.
-  $suggestions[] = $hook . '__' . \Drupal::languageManager()->getLanguage()->id;
+  $suggestions[] = $hook . '__' . \Drupal::languageManager()->getCurrentLanguage()->id;
 }
 
 /**
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TokenReplaceTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TokenReplaceTest.php
index a91675c..2373127 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TokenReplaceTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TokenReplaceTest.php
@@ -66,7 +66,7 @@ function setUp() {
    */
   function testTaxonomyTokenReplacement() {
     $token_service = \Drupal::token();
-    $language_interface = language(Language::TYPE_INTERFACE);
+    $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
     // Create two taxonomy terms.
     $term1 = $this->createTerm($this->vocabulary);
diff --git a/core/modules/user/lib/Drupal/user/AccountFormController.php b/core/modules/user/lib/Drupal/user/AccountFormController.php
index 6002298..b9769f9 100644
--- a/core/modules/user/lib/Drupal/user/AccountFormController.php
+++ b/core/modules/user/lib/Drupal/user/AccountFormController.php
@@ -72,7 +72,7 @@ public function form(array $form, array &$form_state) {
     $user = $this->currentUser();
     $config = \Drupal::config('user.settings');
 
-    $language_interface = language(Language::TYPE_INTERFACE);
+    $language_interface = \Drupal::languageManager()->getCurrentLanguage();
     $register = $account->isAnonymous();
     $admin = $user->hasPermission('administer users');
 
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserTokenReplaceTest.php b/core/modules/user/lib/Drupal/user/Tests/UserTokenReplaceTest.php
index cc706ba..d16b4e2 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserTokenReplaceTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserTokenReplaceTest.php
@@ -43,7 +43,7 @@ public function setUp() {
    */
   function testUserTokenReplacement() {
     $token_service = \Drupal::token();
-    $language_interface = language(Language::TYPE_INTERFACE);
+    $language_interface = \Drupal::languageManager()->getCurrentLanguage();
     $url_options = array(
       'absolute' => TRUE,
       'language' => $language_interface,
diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php
index cfad8fe..665b7a5 100644
--- a/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php
+++ b/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php
@@ -285,7 +285,7 @@ public function generateResultsKey() {
         'build_info' => $build_info,
         'roles' => $user->getRoles(),
         'super-user' => $user->id() == 1, // special caching for super user.
-        'langcode' => language(Language::TYPE_INTERFACE)->id,
+        'langcode' => \Drupal::languageManager()->getCurrentLanguage()->id,
         'base_url' => $GLOBALS['base_url'],
       );
       $request = \Drupal::request();
@@ -315,7 +315,7 @@ public function generateOutputKey() {
         'roles' => $user->getRoles(),
         'super-user' => $user->id() == 1, // special caching for super user.
         'theme' => $GLOBALS['theme'],
-        'langcode' => language(Language::TYPE_INTERFACE)->id,
+        'langcode' => \Drupal::languageManager()->getCurrentLanguage()->id,
         'base_url' => $GLOBALS['base_url'],
       );
 
diff --git a/core/modules/views/views.api.php b/core/modules/views/views.api.php
index d48f789..faacf8a 100644
--- a/core/modules/views/views.api.php
+++ b/core/modules/views/views.api.php
@@ -341,7 +341,7 @@ function hook_views_query_substitutions(ViewExecutable $view) {
   return array(
     '***CURRENT_VERSION***' => \Drupal::VERSION,
     '***CURRENT_TIME***' => REQUEST_TIME,
-    '***CURRENT_LANGUAGE***' => language(\Drupal\Core\Language\Language::TYPE_CONTENT)->id,
+    '***CURRENT_LANGUAGE***' => \Drupal::languageManager()->getCurrentLanguage(\Drupal\Core\Language\Language::TYPE_CONTENT)->id,
     '***DEFAULT_LANGUAGE***' => language_default()->id,
   );
 }
diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc
index 6c6cd0a..c09971b 100644
--- a/core/modules/views/views.theme.inc
+++ b/core/modules/views/views.theme.inc
@@ -1009,7 +1009,7 @@ function template_preprocess_views_view_rss(&$variables) {
     $variables['link'] = check_url(url($path, $url_options));
   }
 
-  $variables['langcode'] = check_plain(language(Language::TYPE_INTERFACE)->id);
+  $variables['langcode'] = check_plain(\Drupal::languageManager()->getCurrentLanguage()->id);
   $variables['namespaces'] = new Attribute($style->namespaces);
   $variables['items'] = $items;
   $variables['channel_elements'] = format_xml_elements($style->channel_elements);
diff --git a/core/modules/views/views.views_execution.inc b/core/modules/views/views.views_execution.inc
index e730bbb..18039be 100644
--- a/core/modules/views/views.views_execution.inc
+++ b/core/modules/views/views.views_execution.inc
@@ -17,7 +17,7 @@ function views_views_query_substitutions(ViewExecutable $view) {
   return array(
     '***CURRENT_VERSION***' => \Drupal::VERSION,
     '***CURRENT_TIME***' => REQUEST_TIME,
-    '***CURRENT_LANGUAGE***' => language(Language::TYPE_CONTENT)->id,
+    '***CURRENT_LANGUAGE***' => \Drupal::languageManager()->getCurrentLanguage(Language::TYPE_CONTENT)->id,
     '***DEFAULT_LANGUAGE***' => language_default()->id,
   );
 }
