TranslatableInterface::addTranslation

public TranslatableInterface::addTranslation($langcode, array $values = array())

Adds a new translation to the translatable object.

Parameters

string $langcode: The language code identifying the translation.

array $values: (optional) An array of initial values to be assigned to the translatable fields. Defaults to none.

Return value

$this

Throws

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

File

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

Class

TranslatableInterface
Interface for translatable data.

Namespace

Drupal\Core\TypedData

Code

public function addTranslation($langcode, array $values = array());
doc_Drupal
2016-10-29 09:49:01
Comments
Leave a Comment

Please login to continue.