You are here

protected function StringTranslationTrait::getStringTranslation in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/StringTranslation/StringTranslationTrait.php \Drupal\Core\StringTranslation\StringTranslationTrait::getStringTranslation()

Gets the string translation service.

Return value

\Drupal\Core\StringTranslation\TranslationInterface The string translation service.

6 calls to StringTranslationTrait::getStringTranslation()
ConfigSingleImportForm::validateForm in core/modules/config/src/Form/ConfigSingleImportForm.php
Form validation handler.
ConfigSync::submitForm in core/modules/config/src/Form/ConfigSync.php
Form submission handler.
ModulesListConfirmForm::submitForm in core/modules/system/src/Form/ModulesListConfirmForm.php
Form submission handler.
ModulesListForm::submitForm in core/modules/system/src/Form/ModulesListForm.php
Form submission handler.
SimpletestResultsForm::buildForm in core/modules/simpletest/src/Form/SimpletestResultsForm.php
Form constructor.

... See full list

File

core/lib/Drupal/Core/StringTranslation/StringTranslationTrait.php, line 109
Contains \Drupal\Core\StringTranslation\StringTranslationTrait.

Class

StringTranslationTrait
Wrapper methods for \Drupal\Core\StringTranslation\TranslationInterface.

Namespace

Drupal\Core\StringTranslation

Code

protected function getStringTranslation() {
  if (!$this->stringTranslation) {
    $this->stringTranslation = \Drupal::service('string_translation');
  }
  return $this->stringTranslation;
}