Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. StringTranslationTrait.php

function StringTranslationTrait::getStringTranslation

Gets the string translation service.

Return value

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

11 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.
EntityType::getBundleLabel in core/lib/Drupal/Core/Entity/EntityType.php
Gets the label for the bundle.
EntityType::getCollectionLabel in core/lib/Drupal/Core/Entity/EntityType.php
Gets the uppercase plural form of the name of the entity type.
EntityType::getPluralLabel in core/lib/Drupal/Core/Entity/EntityType.php
Gets the indefinite plural form of the name of the entity type.

... See full list

File

core/lib/Drupal/Core/StringTranslation/StringTranslationTrait.php, line 108

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;
}
RSS feed
Powered by Drupal