You are here

public function TranslationManager::translateString in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/StringTranslation/TranslationManager.php \Drupal\Core\StringTranslation\TranslationManager::translateString()

Translates a TranslatableMarkup object to a string.

Parameters

\Drupal\Core\StringTranslation\TranslatableMarkup $translated_string: A TranslatableMarkup object.

Return value

string The translated string.

Overrides TranslationInterface::translateString

File

core/lib/Drupal/Core/StringTranslation/TranslationManager.php, line 116

Class

TranslationManager
Defines a chained translation implementation combining multiple translators.

Namespace

Drupal\Core\StringTranslation

Code

public function translateString(TranslatableMarkup $translated_string) {
  return $this
    ->doTranslate($translated_string
    ->getUntranslatedString(), $translated_string
    ->getOptions());
}