function TranslatableInterface::getTranslation

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/TypedData/TranslatableInterface.php \Drupal\Core\TypedData\TranslatableInterface::getTranslation()
  2. 8.9.x core/lib/Drupal/Core/TypedData/TranslatableInterface.php \Drupal\Core\TypedData\TranslatableInterface::getTranslation()
  3. 10 core/lib/Drupal/Core/TypedData/TranslatableInterface.php \Drupal\Core\TypedData\TranslatableInterface::getTranslation()

Gets a translation of the data.

The returned translation has to be of the same type than this typed data object.

Parameters

$langcode: The language code of the translation to get or LanguageInterface::LANGCODE_DEFAULT to get the data in default language.

Return value

static A typed data object for the translated data.

Throws

\InvalidArgumentException If an invalid or non-existing translation language is specified.

File

core/lib/Drupal/Core/TypedData/TranslatableInterface.php, line 78

Class

TranslatableInterface
Interface for translatable data.

Namespace

Drupal\Core\TypedData

Code

public function getTranslation($langcode);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.