You are here

public function TranslationManager::__construct in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/StringTranslation/TranslationManager.php \Drupal\Core\StringTranslation\TranslationManager::__construct()
  2. 9 core/lib/Drupal/Core/StringTranslation/TranslationManager.php \Drupal\Core\StringTranslation\TranslationManager::__construct()

Constructs a TranslationManager object.

Parameters

\Drupal\Core\Language\LanguageDefault $default_language: The default language.

2 methods override TranslationManager::__construct()
TestTranslationManager::__construct in core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php
Constructs a TranslationManager object.
UnserializableTranslationManager::__construct in core/tests/Drupal/Tests/Core/Entity/EntityTypeTest.php
Constructs a UnserializableTranslationManager object.

File

core/lib/Drupal/Core/StringTranslation/TranslationManager.php, line 52

Class

TranslationManager
Defines a chained translation implementation combining multiple translators.

Namespace

Drupal\Core\StringTranslation

Code

public function __construct(LanguageDefault $default_language) {
  $this->defaultLangcode = $default_language
    ->get()
    ->getId();
}