function language_load

Loads a language object from the database.

Parameters

string $langcode: The language code.

Return value

Drupal\core\Language\Language | FALSE A fully-populated language object or FALSE.

35 calls to language_load()
BlockLanguageTest::testLanguageBlockVisibility in drupal/core/modules/block/lib/Drupal/block/Tests/BlockLanguageTest.php
Tests the visibility settings for the blocks based on language.
comment_tokens in drupal/core/modules/comment/comment.tokens.inc
Implements hook_tokens().
contact_mail in drupal/core/modules/contact/contact.module
Implements hook_mail().
Entity::language in drupal/core/lib/Drupal/Core/Entity/Entity.php
Implements TranslatableInterface::language().
EntityFieldTest::testReadWrite in drupal/core/modules/system/lib/Drupal/system/Tests/Entity/EntityFieldTest.php
Tests reading and writing properties and field items.

... See full list

File

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

Code

function language_load($langcode) {
  $languages = language_list(LANGUAGE_ALL);
  return isset($languages[$langcode]) ? $languages[$langcode] : FALSE;
}