function LocaleTranslation::__construct

Same name in this branch
  1. 8.9.x core/modules/locale/src/Plugin/QueueWorker/LocaleTranslation.php \Drupal\locale\Plugin\QueueWorker\LocaleTranslation::__construct()
Same name and namespace in other branches
  1. 9 core/modules/locale/src/LocaleTranslation.php \Drupal\locale\LocaleTranslation::__construct()
  2. 9 core/modules/locale/src/Plugin/QueueWorker/LocaleTranslation.php \Drupal\locale\Plugin\QueueWorker\LocaleTranslation::__construct()
  3. 10 core/modules/locale/src/LocaleTranslation.php \Drupal\locale\LocaleTranslation::__construct()
  4. 10 core/modules/locale/src/Plugin/QueueWorker/LocaleTranslation.php \Drupal\locale\Plugin\QueueWorker\LocaleTranslation::__construct()
  5. 11.x core/modules/locale/src/LocaleTranslation.php \Drupal\locale\LocaleTranslation::__construct()
  6. 11.x core/modules/locale/src/Plugin/QueueWorker/LocaleTranslation.php \Drupal\locale\Plugin\QueueWorker\LocaleTranslation::__construct()

Constructs a translator using a string storage.

Parameters

\Drupal\locale\StringStorageInterface $storage: Storage to use when looking for new translations.

\Drupal\Core\Cache\CacheBackendInterface $cache: The cache backend.

\Drupal\Core\Lock\LockBackendInterface $lock: The lock backend.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The config factory.

\Drupal\Core\Language\LanguageManagerInterface $language_manager: The language manager.

\Symfony\Component\HttpFoundation\RequestStack $request_stack: The request stack.

File

core/modules/locale/src/LocaleTranslation.php, line 99

Class

LocaleTranslation
String translator using the locale module.

Namespace

Drupal\locale

Code

public function __construct(StringStorageInterface $storage, CacheBackendInterface $cache, LockBackendInterface $lock, ConfigFactoryInterface $config_factory, LanguageManagerInterface $language_manager, RequestStack $request_stack) {
    $this->storage = $storage;
    $this->cache = $cache;
    $this->lock = $lock;
    $this->configFactory = $config_factory;
    $this->languageManager = $language_manager;
    $this->requestStack = $request_stack;
}

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