function TranslationManager::__construct

Same name in other branches
  1. 9 core/lib/Drupal/Core/StringTranslation/TranslationManager.php \Drupal\Core\StringTranslation\TranslationManager::__construct()
  2. 8.9.x core/lib/Drupal/Core/StringTranslation/TranslationManager.php \Drupal\Core\StringTranslation\TranslationManager::__construct()
  3. 10 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.

1 method overrides TranslationManager::__construct()
TestTranslationManager::__construct in core/tests/Drupal/Tests/Core/StringTranslation/TranslationManagerTest.php
Constructs a TranslationManager 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();
}

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