You are here

public function StaticTranslation::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/StringTranslation/Translator/StaticTranslation.php \Drupal\Core\StringTranslation\Translator\StaticTranslation::__construct()

Constructs a translator from an array of translations.

Parameters

array $translations: Array of override strings indexed by language and context

2 calls to StaticTranslation::__construct()
CustomStrings::__construct in core/lib/Drupal/Core/StringTranslation/Translator/CustomStrings.php
Constructs a CustomStrings object.
FileTranslation::__construct in core/lib/Drupal/Core/StringTranslation/Translator/FileTranslation.php
Constructs a StaticTranslation object.
2 methods override StaticTranslation::__construct()
CustomStrings::__construct in core/lib/Drupal/Core/StringTranslation/Translator/CustomStrings.php
Constructs a CustomStrings object.
FileTranslation::__construct in core/lib/Drupal/Core/StringTranslation/Translator/FileTranslation.php
Constructs a StaticTranslation object.

File

core/lib/Drupal/Core/StringTranslation/Translator/StaticTranslation.php, line 31
Contains \Drupal\Core\StringTranslation\Translator\StaticTranslation.

Class

StaticTranslation
String translator with a static cache for translations.

Namespace

Drupal\Core\StringTranslation\Translator

Code

public function __construct($translations = array()) {
  $this->translations = $translations;
}