Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal.php \Drupal::languageManager()
  2. 9 core/lib/Drupal.php \Drupal::languageManager()

Returns the language manager service.

Return value

\Drupal\Core\Language\LanguageManagerInterface The language manager.

172 calls to Drupal::languageManager()
AdminPathEntityConverterLanguageTest::testConfigUsingCurrentLanguage in core/modules/language/tests/src/Functional/AdminPathEntityConverterLanguageTest.php
Tests the translated and untranslated config entities are loaded properly.
AttachedAssetsTest::testAddExternalFiles in core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php
Tests adding external CSS and JavaScript files.
AttachedAssetsTest::testAddFiles in core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php
Tests adding a CSS and a JavaScript file.
AttachedAssetsTest::testAddJsFileWithQueryString in core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php
Tests JavaScript files that have query strings attached get added right.
AttachedAssetsTest::testAddJsSettings in core/tests/Drupal/KernelTests/Core/Asset/AttachedAssetsTest.php
Tests adding JavaScript settings.

... See full list

File

core/lib/Drupal.php, line 605

Class

Drupal
Static Service Container wrapper.

Code

public static function languageManager() {
  return static::getContainer()
    ->get('language_manager');
}