function LanguageManager::getLanguage

Same name in other branches
  1. 9 core/lib/Drupal/Core/Language/LanguageManager.php \Drupal\Core\Language\LanguageManager::getLanguage()
  2. 8.9.x core/lib/Drupal/Core/Language/LanguageManager.php \Drupal\Core\Language\LanguageManager::getLanguage()
  3. 11.x core/lib/Drupal/Core/Language/LanguageManager.php \Drupal\Core\Language\LanguageManager::getLanguage()
2 calls to LanguageManager::getLanguage()
LanguageManager::getLanguageName in core/lib/Drupal/Core/Language/LanguageManager.php
LanguageManager::isLanguageLocked in core/lib/Drupal/Core/Language/LanguageManager.php

File

core/lib/Drupal/Core/Language/LanguageManager.php, line 155

Class

LanguageManager
Class responsible for providing language support on language-unaware sites.

Namespace

Drupal\Core\Language

Code

public function getLanguage($langcode) {
    $languages = $this->getLanguages(LanguageInterface::STATE_ALL);
    return $languages[$langcode] ?? NULL;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.