public TranslatableInterface::getTranslation($langcode)
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
$this 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 63
Class
- TranslatableInterface
- Interface for translatable data.
Namespace
Drupal\Core\TypedData
Code
public function getTranslation($langcode);
Please login to continue.