From b80ec36cc23483f16e0806594195f6ce85c9612d Mon Sep 17 00:00:00 2001
From: Mac_Weber <Mac_Weber@789986.no-reply.drupal.org>
Date: Sat, 14 Dec 2013 15:21:18 -0200
Subject: [PATCH] Issue #2070369 by Mac_Weber, bdgreen, sidharthap: Remove all
 calls to deprecated function language().

---
 core/includes/common.inc                                       |  4 ++--
 core/includes/entity.inc                                       |  4 ++--
 core/includes/form.inc                                         |  2 +-
 core/includes/menu.inc                                         |  6 +++---
 core/includes/theme.inc                                        |  6 +++---
 core/lib/Drupal.php                                            |  2 +-
 core/lib/Drupal/Core/Datetime/DrupalDateTime.php               |  2 +-
 core/lib/Drupal/Core/Entity/EntityViewBuilder.php              |  2 +-
 core/lib/Drupal/Core/Routing/UrlGeneratorInterface.php         |  6 +++---
 core/lib/Drupal/Core/Validation/DrupalTranslator.php           |  2 +-
 core/modules/book/book.module                                  |  2 +-
 core/modules/book/lib/Drupal/book/BookManager.php              |  4 ++--
 core/modules/ckeditor/ckeditor.admin.inc                       |  2 +-
 .../lib/Drupal/comment/Tests/CommentTokenReplaceTest.php       |  2 +-
 .../contact/lib/Drupal/contact/MessageFormController.php       |  2 +-
 core/modules/content_translation/content_translation.module    |  6 +++---
 core/modules/content_translation/content_translation.pages.inc |  4 ++--
 .../Access/ContentTranslationManageAccessCheck.php             |  4 ++--
 core/modules/field/field.deprecated.inc                        |  2 +-
 .../file/lib/Drupal/file/Tests/FileTokenReplaceTest.php        |  2 +-
 core/modules/language/language.module                          |  2 +-
 core/modules/language/language.negotiation.inc                 |  4 ++--
 .../Drupal/language/Tests/LanguageConfigurationElementTest.php |  2 +-
 .../Drupal/language/Tests/LanguageDependencyInjectionTest.php  |  4 ++--
 core/modules/language/tests/language_test/language_test.module |  6 +++---
 .../locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php     |  4 ++--
 core/modules/locale/locale.module                              | 10 +++++-----
 .../node/lib/Drupal/node/Tests/NodeTokenReplaceTest.php        |  2 +-
 core/modules/node/node.module                                  |  4 ++--
 core/modules/search/search.pages.inc                           |  2 +-
 core/modules/simpletest/lib/Drupal/simpletest/TestBase.php     |  2 +-
 .../lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php |  2 +-
 .../system/lib/Drupal/system/Tests/Common/FormatDateTest.php   |  2 +-
 core/modules/system/lib/Drupal/system/Tests/Mail/MailTest.php  |  6 +++---
 .../system/lib/Drupal/system/Tests/System/TokenReplaceTest.php |  8 ++++----
 .../lib/Drupal/plugin_test/Plugin/CachedMockBlockManager.php   |  2 +-
 .../taxonomy/lib/Drupal/taxonomy/Tests/TokenReplaceTest.php    |  2 +-
 core/modules/user/lib/Drupal/user/AccountFormController.php    |  2 +-
 .../user/lib/Drupal/user/Tests/UserTokenReplaceTest.php        |  2 +-
 .../lib/Drupal/views/Plugin/views/cache/CachePluginBase.php    |  4 ++--
 core/modules/views/views.theme.inc                             |  2 +-
 core/modules/views/views.views_execution.inc                   |  2 +-
 42 files changed, 71 insertions(+), 71 deletions(-)

diff --git a/core/includes/common.inc b/core/includes/common.inc
index c946eaf..944c615 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -780,7 +780,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()->getLanguage(Language::TYPE_CONTENT)->id;
 
   $output = "<channel>\n";
   $output .= ' <title>' . String::checkPlain($title) . "</title>\n";
@@ -1254,7 +1254,7 @@ function l($text, $path, array $options = array()) {
     $active = array(
       'path' => current_path(),
       'front_page' => drupal_is_front_page(),
-      'language' => language(Language::TYPE_URL)->id,
+      'language' => \Drupal::languageManager()->getLanguage(Language::TYPE_URL)->id,
       'query' => \Drupal::service('request')->query->all(),
     );
   }
diff --git a/core/includes/entity.inc b/core/includes/entity.inc
index 4dddce1..ee8779a 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()->getLanguage()->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()->getLanguage()->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 87f8edf..257c3cb 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()->getLanguage();
 
   // Apply default form element properties.
   $element += array(
diff --git a/core/includes/menu.inc b/core/includes/menu.inc
index b83c323..a4b6627 100644
--- a/core/includes/menu.inc
+++ b/core/includes/menu.inc
@@ -1185,7 +1185,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()->getLanguage();
 
   // Use $mlid as a flag for whether the data being loaded is for the whole tree.
   $mlid = isset($link['mlid']) ? $link['mlid'] : 0;
@@ -1296,7 +1296,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()->getLanguage();
 
   // Check if the active trail has been overridden for this menu tree.
   $active_path = menu_tree_get_path($menu_name);
@@ -1464,7 +1464,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()->getLanguage();
 
   // 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 6be3c3f..7dd0ce5 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -2060,7 +2060,7 @@ function _template_preprocess_default_variables() {
  * @see system_elements()
  */
 function template_preprocess_html(&$variables) {
-  $language_interface = language(Language::TYPE_INTERFACE);
+  $language_interface = \Drupal::languageManager()->getLanguage();
 
   // Compile a list of classes that are going to be applied to the body element.
   // This allows advanced theming based on context (home page, node of certain type, etc.).
@@ -2194,7 +2194,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()->getLanguage();
   $site_config = \Drupal::config('system.site');
 
   // Move some variables to the top level for themer convenience and template cleanliness.
@@ -2365,7 +2365,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()->getLanguage();
   // 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 5441e30..4c0e256 100644
--- a/core/lib/Drupal.php
+++ b/core/lib/Drupal.php
@@ -413,7 +413,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()->getLanguage(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..7b2d88e 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()->getLanguage()->id;
     }
 
     if (!isset($settings['country'])) {
diff --git a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
index c2db6b0..5dc61db 100644
--- a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
+++ b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
@@ -186,7 +186,7 @@ public function view(EntityInterface $entity, $view_mode = 'full', $langcode = N
    */
   public function viewMultiple(array $entities = array(), $view_mode = 'full', $langcode = NULL) {
     if (!isset($langcode)) {
-      $langcode = language(Language::TYPE_CONTENT)->id;
+      $langcode = \Drupal::languageManager()->getLanguage(Language::TYPE_CONTENT)->id;
     }
 
     // Build the view modes and display objects.
diff --git a/core/lib/Drupal/Core/Routing/UrlGeneratorInterface.php b/core/lib/Drupal/Core/Routing/UrlGeneratorInterface.php
index a2ce7d1..0c8248f 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()->getLanguage(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()->getLanguage(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..3dbb470 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()->getLanguage()->id;
   }
 
   /**
diff --git a/core/modules/book/book.module b/core/modules/book/book.module
index ec8cf4c..287757b 100644
--- a/core/modules/book/book.module
+++ b/core/modules/book/book.module
@@ -710,7 +710,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()->getLanguage();
 
   $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 9b415a8..3c96d3d 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()->getLanguage();
 
     // 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()->getLanguage();
 
     // 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 764d557..ab41c54 100644
--- a/core/modules/ckeditor/ckeditor.admin.inc
+++ b/core/modules/ckeditor/ckeditor.admin.inc
@@ -13,7 +13,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()->getLanguage();
   $variables['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..a252a59 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()->getLanguage();
     $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 ca4a607..7218a42 100644
--- a/core/modules/contact/lib/Drupal/contact/MessageFormController.php
+++ b/core/modules/contact/lib/Drupal/contact/MessageFormController.php
@@ -133,7 +133,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()->getLanguage();
     $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 73dcca9..4f7470a 100644
--- a/core/modules/content_translation/content_translation.module
+++ b/core/modules/content_translation/content_translation.module
@@ -347,7 +347,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()->getLanguage(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');
@@ -363,7 +363,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()->getLanguage(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');
@@ -379,7 +379,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()->getLanguage(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 fca8b9a..6214d06 100644
--- a/core/modules/content_translation/content_translation.pages.inc
+++ b/core/modules/content_translation/content_translation.pages.inc
@@ -192,7 +192,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()->getLanguage(Language::TYPE_CONTENT);
   // @todo Exploit the upcoming hook_entity_prepare() when available.
   content_translation_prepare_translation($entity, $source, $target);
   $info = $entity->entityInfo();
@@ -219,7 +219,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()->getLanguage(Language::TYPE_CONTENT);
   $info = $entity->entityInfo();
   $operation = isset($info['default_operation']) ? $info['default_operation'] : 'default';
   $form_state['langcode'] = $language->id;
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 16cc31a..913a971 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
@@ -63,7 +63,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()->getLanguage(Language::TYPE_CONTENT);
           return ($source->id != $target->id
             && isset($languages[$source->id])
             && isset($languages[$target->id])
@@ -74,7 +74,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()->getLanguage(Language::TYPE_CONTENT);
           return isset($languages[$language->id])
             && $language->id != $entity->getUntranslated()->language()->id
             && isset($translations[$language->id])
diff --git a/core/modules/field/field.deprecated.inc b/core/modules/field/field.deprecated.inc
index 9698106..98820dc 100644
--- a/core/modules/field/field.deprecated.inc
+++ b/core/modules/field/field.deprecated.inc
@@ -857,7 +857,7 @@ function field_valid_language($langcode, $default = TRUE) {
   if (in_array($langcode, $languages)) {
     return $langcode;
   }
-  return $default ? language_default()->id : language(Language::TYPE_CONTENT)->id;
+  return $default ? language_default()->id : \Drupal::languageManager()->getLanguage(Language::TYPE_CONTENT)->id;
 }
 
 /**
diff --git a/core/modules/file/lib/Drupal/file/Tests/FileTokenReplaceTest.php b/core/modules/file/lib/Drupal/file/Tests/FileTokenReplaceTest.php
index 924c2b9..6a51d64 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()->getLanguage();
 
     // Create file field.
     $type_name = 'article';
diff --git a/core/modules/language/language.module b/core/modules/language/language.module
index b0dd216..fb9addd 100644
--- a/core/modules/language/language.module
+++ b/core/modules/language/language.module
@@ -394,7 +394,7 @@ function language_get_default_langcode($entity_type, $bundle) {
   }
 
   $default_value = NULL;
-  $language_interface = language(Language::TYPE_INTERFACE);
+  $language_interface = \Drupal::languageManager()->getLanguage();
   switch ($configuration['langcode']) {
     case 'site_default':
       $default_value = language_default()->id;
diff --git a/core/modules/language/language.negotiation.inc b/core/modules/language/language.negotiation.inc
index f87284d..bf69cb1 100644
--- a/core/modules/language/language.negotiation.inc
+++ b/core/modules/language/language.negotiation.inc
@@ -57,7 +57,7 @@
  *   The current interface language code.
  */
 function language_from_interface() {
-  return language(Language::TYPE_INTERFACE)->id;
+  return \Drupal::languageManager()->getLanguage()->id;
 }
 
 /**
@@ -410,7 +410,7 @@ function language_switcher_url($type, $path) {
  */
 function language_switcher_session($type, $path) {
   $param = \Drupal::config('language.negotiation')->get('session.parameter');
-  $language_query = isset($_SESSION[$param]) ? $_SESSION[$param] : language($type)->id;
+  $language_query = isset($_SESSION[$param]) ? $_SESSION[$param] : \Drupal::languageManager()->getLanguage($type)->id;
 
   $languages = language_list();
   $links = array();
diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageConfigurationElementTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageConfigurationElementTest.php
index d5a3c02..8177f3a 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()->getLanguage();
     $this->assertEqual($langcode, $language_interface->id);
 
     // Site's default.
diff --git a/core/modules/language/lib/Drupal/language/Tests/LanguageDependencyInjectionTest.php b/core/modules/language/lib/Drupal/language/Tests/LanguageDependencyInjectionTest.php
index ca49673..b736ed4 100644
--- a/core/modules/language/lib/Drupal/language/Tests/LanguageDependencyInjectionTest.php
+++ b/core/modules/language/lib/Drupal/language/Tests/LanguageDependencyInjectionTest.php
@@ -49,7 +49,7 @@ function testDependencyInjectedNewLanguage() {
     drupal_language_initialize();
 
     $expected = language_default();
-    $result = language(Language::TYPE_INTERFACE);
+    $result = \Drupal::languageManager()->getLanguage();
     foreach ($expected as $property => $value) {
       $this->assertEqual($expected->$property, $result->$property, format_string('The dependency injected language object %prop property equals the new Language object %prop property.', array('%prop' => $property)));
     }
@@ -79,7 +79,7 @@ function testDependencyInjectedNewDefaultLanguage() {
     // The language system creates a Language object which contains the
     // same properties as the new default language object.
     $expected = new Language($new_language_default);
-    $result = language(Language::TYPE_INTERFACE);
+    $result = \Drupal::languageManager()->getLanguage();
     foreach ($expected as $property => $value) {
       $this->assertEqual($expected->$property, $result->$property, format_string('The dependency injected language object %prop property equals the default language object %prop property.', array('%prop' => $property)));
     }
diff --git a/core/modules/language/tests/language_test/language_test.module b/core/modules/language/tests/language_test/language_test.module
index 8e8cbaf..bded1a8 100644
--- a/core/modules/language/tests/language_test/language_test.module
+++ b/core/modules/language/tests/language_test/language_test.module
@@ -15,8 +15,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()->getLanguage()->id) && isset(\Drupal::languageManager()->getLanguage()->method_id)) {
+    drupal_set_message(t('Language negotiation method: @name', array('@name' => \Drupal::languageManager()->getLanguage()->method_id)));
   }
 }
 
@@ -98,7 +98,7 @@ function language_test_store_language_negotiation() {
   $last = array();
   print_r(language_types_get_all());
   foreach (language_types_get_all() as $type) {
-    $last[$type] = language($type)->id;
+    $last[$type] = \Drupal::languageManager()->getLanguage($type)->id;
   }
   \Drupal::state()->set('language_test.language_negotiation_last', $last);
 }
diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php
index cd8ec73..73ad759 100644
--- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php
+++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleUninstallTest.php
@@ -62,7 +62,7 @@ function testUninstallProcess() {
     $language_manager->reset();
     $language_manager->init();
     // Check the UI language.
-    $this->assertEqual(language(Language::TYPE_INTERFACE)->id, $this->langcode, String::format('Current language: %lang', array('%lang' => language(Language::TYPE_INTERFACE)->id)));
+    $this->assertEqual(\Drupal::languageManager()->getLanguage()->id, $this->langcode, String::format('Current language: %lang', array('%lang' => \Drupal::languageManager()->getLanguage()->id)));
 
     // Enable multilingual workflow option for articles.
     language_save_default_configuration('node', 'article', array('langcode' => 'site_default', 'language_show' => TRUE));
@@ -108,7 +108,7 @@ function testUninstallProcess() {
     // Visit the front page.
     $this->drupalGet('');
     // Check the init language logic.
-    $this->assertEqual(language(Language::TYPE_INTERFACE)->id, 'en', String::format('Language after uninstall: %lang', array('%lang' => language(Language::TYPE_INTERFACE)->id)));
+    $this->assertEqual(\Drupal::languageManager()->getLanguage()->id, 'en', String::format('Language after uninstall: %lang', array('%lang' => \Drupal::languageManager()->getLanguage()->id)));
 
     // Check JavaScript files deletion.
     $this->assertTrue($result = !file_exists($js_file), String::format('JavaScript file deleted: %file', array('%file' => $result ? $js_file : 'found')));
diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module
index e9b539c..7d7dfbf 100644
--- a/core/modules/locale/locale.module
+++ b/core/modules/locale/locale.module
@@ -311,7 +311,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()->getLanguage();
 
   // Used to locally cache the plural formulas for all languages.
   $plural_formulas = &drupal_static(__FUNCTION__, array());
@@ -580,7 +580,7 @@ function locale_js_alter(&$javascript) {
  *   applicable.
  */
 function locale_js_translate(array $files = array()) {
-  $language_interface = language(Language::TYPE_INTERFACE);
+  $language_interface = \Drupal::languageManager()->getLanguage();
 
   $dir = 'public://' . \Drupal::config('locale.settings')->get('javascript.directory');
   $parsed = \Drupal::state()->get('system.javascript_parsed') ?: array();
@@ -669,7 +669,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()->getLanguage();
     // 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.
@@ -854,7 +854,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()->getLanguage();
 
     $node_language = $variables['node']->language();
     if ($node_language->id != $language_interface->id) {
@@ -1294,7 +1294,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()->getLanguage();
   }
   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..b0cbdec 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()->getLanguage();
     $url_options = array(
       'absolute' => TRUE,
       'language' => $language_interface,
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index a850c8a..574aebe 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -347,7 +347,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()->getLanguage()->id;
   if ($cache = cache()->get($cid)) {
     return $cache->data;
   }
@@ -1315,7 +1315,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()->getLanguage(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..b45eb40 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()->getLanguage();
 
   $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 882542e..3b600fe 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
@@ -899,7 +899,7 @@ protected function changeDatabasePrefix() {
    */
   protected function prepareEnvironment() {
     global $user, $conf;
-    $language_interface = language(Language::TYPE_INTERFACE);
+    $language_interface = \Drupal::languageManager()->getLanguage();
 
     // 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..ce7e1a6 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()->getLanguage();
 
     // Create user and node.
     $user = $this->drupalCreateUser(array('create page content'));
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..f80accd 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()->getLanguage();
 
     $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 4326c96..3088607 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()->getLanguage();
 
     // 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()->getLanguage();
 
     // Reset the class variable holding a copy of the last sent message.
     self::$sent_message = NULL;
@@ -81,7 +81,7 @@ public function testCancelMessage() {
    * Checks for the site name in an auto-generated From: header.
    */
   function testFromHeader() {
-    global $language;
+    $language = \Drupal::languageManager()->getLanguage();
 
     // 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..dee8139 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()->getLanguage();
 
     $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()->getLanguage();
 
     // 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()->getLanguage();
     $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()->getLanguage();
 
     // Set time to one hour before request.
     $date = REQUEST_TIME - 3600;
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..e919470 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()->getLanguage()->id, 'cache',  1542646800, array('plugin_test'));
   }
 }
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TokenReplaceTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TokenReplaceTest.php
index a91675c..cff917c 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()->getLanguage();
 
     // 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 4983b0f..bf8be95 100644
--- a/core/modules/user/lib/Drupal/user/AccountFormController.php
+++ b/core/modules/user/lib/Drupal/user/AccountFormController.php
@@ -56,7 +56,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()->getLanguage();
     $register = $account->isAnonymous();
     $admin = user_access('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..3c4ddab 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()->getLanguage();
     $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 e51b1e1..06a0a54 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
@@ -286,7 +286,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()->getLanguage()->id,
         'base_url' => $GLOBALS['base_url'],
       );
       $request = \Drupal::request();
@@ -316,7 +316,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()->getLanguage()->id,
         'base_url' => $GLOBALS['base_url'],
       );
 
diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc
index 6c6cd0a..66e9c82 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()->getLanguage()->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..cae6b3f 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()->getLanguage(Language::TYPE_CONTENT)->id,
     '***DEFAULT_LANGUAGE***' => language_default()->id,
   );
 }
-- 
1.8.4.rc2

