W3cubDocs

/Drupal 8

public function TranslationManager::__construct

public TranslationManager::__construct(LanguageDefault $default_language)

Constructs a TranslationManager object.

Parameters

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

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();
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!StringTranslation!TranslationManager.php/function/TranslationManager::__construct/8.1.x