public function TranslatableInterface::getTranslation

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);

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!TypedData!TranslatableInterface.php/function/TranslatableInterface::getTranslation/8.1.x