function language

8.x bootstrap.inc language($type)

Returns the language object for a given language type.

Parameters

string $type: The type of language object needed, e.g. Language::TYPE_INTERFACE.

Deprecated

as of Drupal 8.0. Use Drupal::service('language_manager')->getLanguage($type).

See also

Drupal\Core\Language\LanguageManager

43 calls to language()
ConditionManager::__construct in drupal/core/lib/Drupal/Core/Condition/ConditionManager.php
Constructs aa ConditionManager object.
ConstraintManager::__construct in drupal/core/lib/Drupal/Core/Validation/ConstraintManager.php
Overrides \Drupal\Component\Plugin\PluginManagerBase::__construct().
DrupalDateTime::__construct in drupal/core/lib/Drupal/Core/Datetime/DrupalDateTime.php
Constructs a date object.
DrupalTranslator::getLocale in drupal/core/lib/Drupal/Core/Validation/DrupalTranslator.php
Implements \Symfony\Component\Translation\TranslatorInterface::getLocale().
drupal_render_cid_parts in drupal/core/includes/common.inc
Returns cache ID parts for building a cache ID.

... See full list

70 string references to 'language'
block_language_delete in drupal/core/modules/block/block.module
Implements hook_language_delete().
comment_tokens in drupal/core/modules/comment/comment.tokens.inc
Implements hook_tokens().
comment_translation_configuration_element_submit in drupal/core/modules/comment/comment.module
Form submission handler for node_type_form().
comment_update_8000 in drupal/core/modules/comment/comment.install
Renames {comment}.language to {comment}.langcode.
comment_views_data in drupal/core/modules/comment/comment.views.inc
Implements hook_views_data().

... See full list

File

drupal/core/includes/bootstrap.inc, line 2437
Functions that need to be loaded on every Drupal request.

Code

function language($type) {
  return Drupal::service('language_manager')->getLanguage($type);
}