public function StaticTranslation::__construct in Drupal 8
Same name and namespace in other branches
- 9 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 26
Class
- StaticTranslation
- String translator with a static cache for translations.
Namespace
Drupal\Core\StringTranslation\TranslatorCode
public function __construct($translations = []) {
$this->translations = $translations;
}